<atlas:ScriptManagerID="ScriptManager1"runat="server"/>
<div>
Inputanintegerfrom1to5.<br/>
<inputid="myTextBox"type="text"/><br/>
Selectanitem.<br/>
<selectid="mySelect">
<optionvalue="1">value1</option>
<optionvalue="2">value2</option>
<optionvalue="3">value3</option>
<optionvalue="4">value4</option>
<optionvalue="5">value5</option>
</select>
</div>
<pagexmlns:script="http://schemas.microsoft.com/xml-script/2005">
<references>
</references>
<components>
<textBoxid="myTextBox">
<bindings>
<bindingdataContext="mySelect"dataPath="selectedValue"property="text"direction="InOut"/>
</bindings>
</textBox>
<selectid="mySelect"/>
</components>
</page>
var_text;
var_changeHandler;

this.get_text=function()
{
returnthis.element.value;
}

this.set_text=function(value)
{
if(this.element.value!=value)
{
this.element.value=value;
this.raisePropertyChanged('text');
}
}

this.initialize=function()
{
Sys.UI.TextBox.callBaseMethod(this,'initialize');
_text=this.element.value;
_changeHandler=Function.createDelegate(this,this._onChanged);
this.element.attachEvent('onchange',_changeHandler);
_keyPressHandler=Function.createDelegate(this,this._onKeyPress);
this.element.attachEvent('onkeypress',_keyPressHandler);
}

this._onChanged=function()
{
if(this.element.value!=_text)
{
_text=this.element.value;
this.raisePropertyChanged('text');
}
}新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注