Hide and Show Div on Page_Load

  • Thread starter Thread starter Shapper
  • Start date Start date
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
 
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
 
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
 
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

Back
Top