ASP.NET Master Page Content Page's elements all seem to be having their ID's changed or prepended by the ASP.NET page renderer.
This breaks all CSS styles based on the original element IDs.
Is this seriously how it works? If so, is there a way around it?
I think you need to use the
ClientID
property instead of theID
property.Documentation: http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientid.aspx
Yes, you can specify the
ClientIDMode
set it to static.examples:
Client Side
Code Behind
By setting it to static...
Update thanks to @Chris Lively for the additional info
Page Level
Application Level
references:
http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode.aspx
http://beyondrelational.com/blogs/hima/archive/2010/07/16/all-about-client-id-mode-in-asp-net-4.aspx