Question

I have an ASP.NET 2.0 web application, and on one of the pages I have a div defined like this:

<asp:Panel runat="server" ID="pnlAddJobCode" Visible="false" ClientIDMode="Static">

and it's inside of a content placeholder defined like this:

<asp:Content ID="Content3" ContentPlaceHolderID="MainBodyContent" runat="server">

but when the HTML is generated I get a name like this ctl00_MainBodyContent_pnlAddJobCode so clearly it's not honoring the ClientIDMode. The problem is I need to set some styles on this specific div -how can I get the ClientIDMode to work here?

Does ClientIDMode not work in ASP.NET 2.0? I have found a few articles on Google that elude to it not working, but nothing concrete.

Was it helpful?

Solution

Client ID Mode is new in ASP.NET 4.0. There's more information about it in the breaking changes for ASP.NET v4.0.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top