Reputation: 2647
I have user control that uses a Response.Redirect("Default.aspx")
. The problem starts when this control is used in files that are located in subdirectories and I try to redirect up a level.
Conversely, if I use ../Default.aspx
, redirects in the top level will break.
Is there another way to code this?
Upvotes: 1
Views: 3096
Reputation: 928
if you want to go up level directory or your Default.aspx page in main directory go at link https://stackoverflow.com/a/16277982/7300644
or use
Response.Redirect("~/Default.aspx");
or
Response.Redirect("../Default.aspx");
Upvotes: 1
Reputation: 60
Why not use complete path, something like this,
Response.Redirect("~/directory/subdirectory/Default.aspx");
Upvotes: 0