Redirecting in a usercontrol

  • Thread starter Thread starter Eirik Eldorsen
  • Start date Start date
E

Eirik Eldorsen

If I try to redirect in usercontrol using only a relative url like
Response.Redirect("somepage.aspx") it will fail several places since it
tries to find the page in the folder whcih the user control is used in. One
solution is to use an url like
Response.Redirect("/somefolder/somepage.aspx"). My problem with this
solution is that it dosen't work when running on localhost. Are there any
other solutions?

Eirik Eldorsen
 
You can use ~ to specify the application's root:

Response.Redirect("~/somepage.aspx", true);

Karl
 
Wow! Thanks! I did'nt think there were any other solutions. Testing on
localhost will be so much easier now :-D
 
Back
Top