Hide and Show Div on Page_Load

S

Shapper

Hello,

I need to hide or show a div on page_load. How can I do it?

I have this in my aspx.vb file:
....
dloginerror.visible = "false"
....

But it says the name is not declared.
How can I declare it?

Is this the right way to do this?

Thanks,
Miguel
 
G

garethdjames

create an <asp:panel> in your apsx page, click on the designer then hit
F7 to go to the code behind,

you should now have a class member variable that you can set visible
 
S

Shapper

I just solved it by declaring:
Protected WithEvents myDiv As HtmlGenericControl

Is there any problem of using a div instead of an asp:panel?

What are the good and bad things about one and the other?

Thanks,
Miguel
 
G

garethdjames

Its fine to do it like you have, you get more control be creating a
panel though

The Panel is a server side control and therefore has properties and can
participate in viewstate
 

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,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top