Link to home
Start Free TrialLog in
Avatar of johnqtr
johnqtr

asked on

Showing next aspx page

I'm new to VB.NET and in VB6 I used to write this to go to the next form.

Private Sub Button1_Click

Form2.Show

End Sub

But in VB.NET that doesn't work.

I have a aspx page called Main.aspx and I have a button named button1, what code do I write so that when I click on button1 it goes to the next aspx page called "search.aspx"?
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

with .NET there is no such things as the VB6 Forms collection.  YOu must create an instance of the form you want to use, sort of like this:

Private Sub Button1_Click(ByVal sender as Object, ByVal e as System.EventArgs)

   Dim frm2 as New Form2

   frm2.Show vbModal

End Sub
ASKER CERTIFIED SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial