How to get <DIV> in code behind page

R

Robert

In the page behind code during the Page_Load event, how
can I get/set the attributes of a <DIV> tag using
VBScript?

For example, with the following <div> tag, how do I get
to this object and change the style attribute to DISPLAY:
block?

<div id="divTopicHeading2" style="DISPLAY: none">
 
C

Curt_C [MVP]

easiest is give it a "runat=server" tag, then declare it in the codebehind
and use the .Attributes call.

Also, are you talking VBScript or VB.NET? I hadn't heard of any vbscript in
ASP.NET?
 
K

Kevin Spencer

Try using a Panel Control. It renders a div.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
M

Michael Ramey

Be sure to check your replies over at the asp.net/forums as well. I'm
really glad to see that you have learned how to cut/paste your questions so
the most amount of people possible get the chance to spend their time
answering your question that has already been answered.
 
R

Robert

Sorry I'm new at .NET and VB.NET. Thanks, using the
Panel Control was exactly what I needed.
 

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

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,295
Latest member
EmilG1510

Latest Threads

Top