在page_load中添加自定义事件如下:
这一句执行,正常
TxtPONO.Attributes.Add("onMouseOut", "alert('abc')")
这一句执行,也正常
TxtPONO.Attributes("onblur") = "javascript:alert('Hello! Focus lost from text box!!');"
但这一句执行,不正常
TxtPONO.Attributes.Add("onTextChanged", "alert('abc')")
不正常的具体情况为在txtPONO中输入字符时没有弹出alert窗口。这是为什么?
类似的情况还有,在.aspx的代码页中,这样定义textbox:
<asp:TextBox ID="TxtPONO" runat="server" onmouseout="mout" onclick="mclick()" ontextchanged="mchange"></asp:TextBox>三个事件中,onmouseout, onclick正常,只要添加了ontextchanged就提示出错。无法运行。怎样添加这个事件?我查过这是服务器端事件,不能在客户端自已添加这样的事件?
这一句执行,正常
TxtPONO.Attributes.Add("onMouseOut", "alert('abc')")
这一句执行,也正常
TxtPONO.Attributes("onblur") = "javascript:alert('Hello! Focus lost from text box!!');"
但这一句执行,不正常
TxtPONO.Attributes.Add("onTextChanged", "alert('abc')")
不正常的具体情况为在txtPONO中输入字符时没有弹出alert窗口。这是为什么?
类似的情况还有,在.aspx的代码页中,这样定义textbox:
<asp:TextBox ID="TxtPONO" runat="server" onmouseout="mout" onclick="mclick()" ontextchanged="mchange"></asp:TextBox>三个事件中,onmouseout, onclick正常,只要添加了ontextchanged就提示出错。无法运行。怎样添加这个事件?我查过这是服务器端事件,不能在客户端自已添加这样的事件?
TxtPONO.Attributes.Add("onChange", "alert('abc')")
當輸入內容時(textchange發生)沒有執行alert,當焦點離開txtPONO時,Alert執行。
我想問這個onChange是系統內定的事件?從哪裏可以查到還有哪些事件?還是說可以自已隨意寫一個名稱?比如dropdownlist.selectindexchanged有一個對應的onchange?