How to access a server-side div in code behind (inside content page)?
mean there is a div in content page like below:
<div id="MyDiv" runat="server">
</div>
but the code below does not work:
MyDiv.Style.Add("display", "none");
EDIT
I am so sorry and that was my mistake!
The codes upper are correct and work perfect and there is no problem about them. My mistake was about my css and after fixing it every thing was ok.
so really thanks for attention and answers.
to access element from content page you can use below code:
HtmlGenericControl myDiv = (HtmlGenericControl)MyDiv;
myDiv.Style.Add("Display", "none");