Accessing DOM from codebehind

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
 
S

Scott Allen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top