When I use asp.net controls, (like inputs), I specify an ID in the markup; however, when I deploy the solution it’s been prefixed with some automatically generated ASP.net identifiers with my original ID appended on the end.
I don’t want to use the server side tag workaround present in other SO questions to give my jQuery a fixed ID to latch onto because it discourages using external JS files. Does 4.0 give you more control over your IDs?
Yes, simply add
ClientIDMode="Static"to your control.Alternatively, and this has always been possible, you can output the control’s HTML ID straight into your javascript:
ClientIDModereference: http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode.aspx