I have seen that BindableAttribute is used to decorate public properties in custom controls.
MSDN briefly mentions that it provides the ability to control the binding direction and whether binding is supported at design time.
public class MyControl : Panel
{
[Bindable(BindableSupport.No, BindingDirection.OneWay)]
public string MyString { get; set; }
}
var myControl = new MyControl();
var myString = myControl.MyString;
Questions:
1) I set BindableSupport
to No, however I could still do this in markup (.aspx).
What does BindableSupport
affect then? Does it hide the property in the toolbox?
<cc:MyControl runat="server" MyString="something" />
2) How does one-way binding and two-way binding work in the context of custom controls and ASP.NET?
Would appreciate any inputs.