<Div reference in asp.net

G

Guest

A very basic question: how can I set the visible property of a Div section in
the Page_load Sub?

I tryed:

Protected Sub Page_Load( ...

Me.Master.FindControl("MyDivName").Visible= true

End Sub


HTML form:

<DIV id="MyDivName" ...... /DIV>

Thanks
 
C

cannontrodder

Set the div to have a runat="server" attribute. You can then
programmatically alter any property server-side.

eg:

<div id="mydiv" runat="server"></div>

And in page_load:

mydiv.InnerHtml = "text in my div"

or

mydiv.Visiible = False
 
W

Winista

ASP:panel control is equivalent to DIV HTML tag. You can use Panel control
and then control its attributes at run time.
 
G

Guest

Thank you very much
--
bruno


Winista said:
ASP:panel control is equivalent to DIV HTML tag. You can use Panel control
and then control its attributes at run time.
 

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
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top