Click here to Skip to main content
15,893,904 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
li2.Attributes.Add("onClick", "chageClass('" & li2.ClientID & "');")



when i click order link it give error object expected,
and see on view source following code seen.

<li id="ctl00_li2" onClick="chageClass(&#39;ctl00_li2&#39;);"><a onclick="checklist(this);" href="#">Orders</a></li>


Please help me this code on Master page.
Posted

1 solution

If you are working on ASP.NET 4.0 there is rather simple fix, just set the control property
ClientIDMode="Static"
and it will retain the ID you specified. The only exception to this is when your control is databound and needs to repeat and in which case you will have to use
ClientIDMode="Predictable"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900