Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple forms (Warning: NuB on the loose!)

Status
Not open for further replies.

RebLazer

Programmer
Jun 7, 2002
438
US
I need to make a page with multiple screens. Is there a way to have one .VB file and have it switch between multiple webforms.

Would someone post a small chunk of sample code that could be stored in one .VB file and, let's say, upon clicking "Button1" it would display webform1; and upon clicking "Button2" it would display webform2?

Thanks!
Lazer
 
Use Panels, they are great.

...aspx
Code:
<asp:panel id=pnl1 runat=server>
Stuff in view 1
</asp:panel>
<asp:panel id=pnl2 runat=server>
Stuff in view 2
</asp:panel>

...vb
Code:
Sub Page_Load(...)
    pnl1.Visible=true
    pnl2.Visible=false
End Sub

Sub btClick(...)
    pnl1.Visible=false
    pnl2.Visible=true
End Sub

make sense?


 
Thank you very much! That may be obvious to you, but it helped a great deal!

:)
Lazer
 
they were very not obvious in the not too distant past [wink]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top