<Div reference in asp.net

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
ASP:Panel control is equivalent to DIV HTML tag. You can use Panel control
and then control its attributes at run time.
 
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.
 
thanks
--
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

Back
Top