Div in aspnet

W

wandali

Hello,

I wonder if there is any web forms control or anything else which
allows me to have similar feature as the html tag <div>, in which all
controls within the div will disappear, when I hide it. And more
important is all controls underneath it will shift up...
Thanks in advance.
Wanda
 
H

Hans Kesting

Hello,

I wonder if there is any web forms control or anything else which
allows me to have similar feature as the html tag <div>, in which all
controls within the div will disappear, when I hide it. And more
important is all controls underneath it will shift up...
Thanks in advance.
Wanda

Why not use that <div>, with an "id" attribute and a "runat=server" ?
Then you want to set the property "Visible" to "false".

Hans Kesting
 
J

john morales

Hello (e-mail address removed),

Look into the panel control.

<asp:panel></asp:panel>

-john
 
R

Ralf Müller

Hi Wanda,

I'm using System.Web.UI.WebControls.Panel for that purpose (it acts as
container for other controls, you can apply css styles to it and you can
make it invisible), but I guess you could also try
System.Web.UI.HtmlControls.HtmlGenericControl ...

Greetings, Ralf
 
H

Hans Kesting

Wanda said:
Then what will the exact syntax to setting the div visible = false?

Thanks

if you use <div id="myDiv" runat="server"></div>
then you should have a 'HtmlGenericControl myDiv' in your codebehind
(if not, switch to design-view and back. The value of the "id" attribute
becomes the name of the codebehind-variable)
then you can use 'myDiv.Visible = false'

Hans Kesting
 

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,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top