Accessing DOM from codebehind

  • Thread starter Thread starter bruce_pearson
  • Start date Start date
B

bruce_pearson

General:
I need to dynamically change the class of a DIV element on pageload. I
have not been able to find any resources describing how to access the
page DOM from code behind. Can someone point me to a resources.

Specific:
I have web user control with a property that controls the class applied
to a DIV element. On page load I need to find the element by ID and
change the class.

Thanks,
BP
 
What you can do is give the div runat="server" and id="<a name>"
attributes. ASP.NET will then wire up an HtmlGenericControl for you in
the code-behind file, and you can modify properties like Style, etc,
from code-behind.
 
Back
Top