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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Next Pagge Button - How To?

Status
Not open for further replies.

mpdillon

Programmer
Jan 27, 2004
18
0
0
US
I am trying to make the transition from VB6 to VB.Net and Windows forms to Web Forms. Could someone please show me how to change to a new web page when a button is pressed.
After adding a button to a form, button1. I would like the button1_Click to advance to the next page, SecondPage.aspx. I do not want to use a Link Button.

Default.aspx code:
<asp:Button ID="Button1" runat="server" Text="Button" /><br />

Default.aspx.vb code
Protected Sub Button1_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Button1.Click

End Sub

What code do I use and where does it go?

Serendipitously, the previous thread addressed a Previous Page button(so I won’t have to ask that question). The replies suggest using Java script. Will Java script be necessary to solve my situation?

 
Code:
Protected Sub Button1_Click(ByVal sender As Object,  _
ByVal e As System.EventArgs) Handles Button1.Click
  Response.Redirect("SecondPage.aspx")
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top