can not hook up asp server side control for javascript function
<p>Environment: .NET 2.0, visual studio 2005</p>

<p>in aspx markup, set a control like:</p>

<pre><code>&lt;asp:CheckBox ID="E287" runat="server"  /&gt;
</code></pre>

<p>in code behind, hook up event to a javascript func in Page_Load event like: </p>

<pre><code>Me.E287.Attributes.Add("OnCheckedChanged", "javascript:alert(123);")
</code></pre>

<p>then test the page in browser, and click on the checkbox, no response. check the source, it is:</p>

<pre><code>&lt;span OnCheckedChanged="javascript:alert();"&gt;&lt;input id="E287" type="checkbox" name="E287" /&gt;&lt;/span&gt;
</code></pre>

<p>can't understand. </p>

<p>If change aspx markup like:</p>

<pre><code>&lt;asp:CheckBox ID="E287" runat="server" OnCheckedChanged="javascript:alert(123);" /&gt;
</code></pre>

<p>will get error </p>

<p>BC30456: 'javascript' is not a member of 'ASP.MyPage_aspx'.</p>

<p>Really confused. How to resolve this problem?</p>
