Is there a way to disable the ASP.Net auto-naming?
For instance: When I have a control on my page that sits inside a masterpage instead of being named
theLabel
it is renamed to
ctl00_ContentPlaceHolder1_clist0_rptSelected_ctl05_theLabel
This is the behavior I don’t want.
If you’re lucky enough to be able to target ASP.NET 4.0…
In your page directive, set
ClientIDMOde="Static". This will emit ID’s exactly as you have them in your controls.So if you have:
It will emit this clean ID: