What about Request.Url? Url.Authority provides the host name or Socket (IPAddress: PortNo), and segments provide other parts of the URL. Just omit the LAST segment as it contains the current page name. Therefore, i-1 *.
string myurl = "http://"+Request.Url.Authority; for(int i=0;i<Request.Url.Segments.Length-1;i++) { myurl = myurl + Request.Url.Segments[i]; } myurl = myurl + "login.aspx"; Response.Redirect(myurl);
Aditya Bokade Mar 01 '12 at 13:50 2012-03-01 13:50
source share