Binding is bind property of a component to a control on a page or another component, you can specify transform during binding or even use your own custom transformation.
This is an example of two way binding:
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "default. aspx. cs" inherits = "_ default" %>
untitled page
<SCRIPT type = "text/XML-script">
<Page xmlns: script = "http://schemas.microsoft.com/xml-script/2005">
<Components>
<Textbox id = "textboxinput1"/>
<Textbox id = "textboxinput2">
<Bindings>
<Binding datacontext = "textboxinput1" datapath = "text" property = "text" direction = "inout"/>
</Bindings>
</Textbox>
</Components>
</Page>
</SCRIPT>
</Body>
</Html>
------
Apply transform during binding:
<Textbox id = "textboxnumber"/>
<Label id = "label">
<Bindings>
<Binding datacontext = "textboxnumber" datapath = "text" property = "text" transform = "add" transformerargument = "5"/>
</Bindings>
</Label>
Custom transform during binding:
<Label id = "labeltext">
<Bindings>
<Binding datacontext = "textboxtext" datapath = "text" property = "text"/>
<Binding id = "setcss" datacontext = "selectstyle" datapath = "selectedvalue" property = "cssclass" transform = "doadditionalhandling"/>
</Bindings>
</Label>
This accompanied custom transform, notice the parameter: (defined by Atlas Framework)
<SCRIPT type = "text/JavaScript">
Function doadditionalhandling (sender, eventargs)
{
VaR tbxelem = $ ('textboxtext'). Control;
If (tbxelem. get_text (). length> 0)
{
// The value is that from the select, so let's ensure it's set
// The property here is the cssclass
Eventargs. set_value (eventargs. get_value ());
// Add additional text to the output:
VaR textelem = $ ('labeltext'). Control;
Textelem. set_text (tbxelem. get_text () + "(you used the style selector )");
}
}
</SCRIPT>