Environment: .NET 2.0, visual studio 2005
in aspx markup, set a control like:
<asp:CheckBox ID="E287" runat="server" />
in code behind, hook up event to a javascript func in Page_Load event like:
Me.E287.Attributes.Add("OnCheckedChanged", "javascript:alert(123);")
then test the page in browser, and click on the checkbox, no response. check the source, it is:
<span OnCheckedChanged="javascript:alert();"><input id="E287" type="checkbox" name="E287" /></span>
can't understand.
If change aspx markup like:
<asp:CheckBox ID="E287" runat="server" OnCheckedChanged="javascript:alert(123);" />
will get error
BC30456: 'javascript' is not a member of 'ASP.MyPage_aspx'.
Really confused. How to resolve this problem?