0

In asp.net 3.5 using vb i would like to go to another page in my application when the user clicks a button. what is the command for doing this?

Thank you

1
  • just in case...view my answer posting. This is better if you want to hide variables in the url. Commented May 22, 2009 at 16:51

4 Answers 4

3
Response.Redirect("url")
Sign up to request clarification or add additional context in comments.

Comments

1

As TheTXI mentioned, Response.Redirect will work just fine.

However, your button click code won't run until late in the page life cycle. Your server may have to do quite a bit of extra or unnecessary work first. If this is the only thing you are doing, just wrap the button in an anchor tag:

<a href="url"><asp:button .../></a>

Comments

1

Here is an example of how that would happen

 Public Sub Click (ByVal sender As Object, ByVal e As System.EventArgs)
     Response.Redirect(SelectedItem.Text)
 End Sub

Comments

0

server.Transfer("url",true) is much better to use because it hides the variables you want to pass if there are any.

Comments