void RegisterBindingInfo (ControlBuilder builder, string propName, ref string value)
{
string str = TrimDB (value, false);
if (StrUtils.StartsWith (str, "Bind", true)) {
Match match = bindRegex.Match (str);
if (match.Success) {
string bindingName = match.Groups [1].Value;
TemplateBuilder templateBuilder = builder.ParentTemplateBuilder;
if (templateBuilder == null)
throw new HttpException ("Bind expression not allowed in this context.");
if (templateBuilder.BindingDirection == BindingDirection.OneWay)
return;
string id = builder.GetAttribute ("ID");
if (String.IsNullOrEmpty (id))
throw new HttpException ("Control of type '" + builder.ControlType + "' using two-way binding on property '" + propName + "' must have an ID.");
templateBuilder.RegisterBoundProperty (builder.ControlType, propName, id, bindingName);
}
}
}