문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top