Click here to Skip to main content
15,894,646 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionhow to redirect in a url? Pin
Jassim Rahma17-Jan-13 9:42
Jassim Rahma17-Jan-13 9:42 
I am using this to redirect to comment page:

C#
Response.Redirect(String.Format("~/{0}/Comment/{1}", Page.RouteData.Values["ADDRESS"], Page.RouteData.Values["GUID"]), false);


I want, if the user is not signed in to redirect to /signin but with mentioning the original page so when user signs ij it will automatically redirect to the original page. something like:

C#
if (Session["volow_member_id"] == null || Session["volow_member_guid"] == null)
{
    Response.Redirect("~/Signin/" + String.Format("~/{0}/Comment/{1}", Page.RouteData.Values["ADDRESS"], Page.RouteData.Values["GUID"]), false);
}
else
{
    Response.Redirect(String.Format("~/{0}/Comment/{1}", Page.RouteData.Values["ADDRESS"], Page.RouteData.Values["GUID"]), false);
}
how can i do this?


Technology News @ www.JassimRahma.com

AnswerRe: how to redirect in a url? Pin
Parwej Ahamad18-Jan-13 7:17
professionalParwej Ahamad18-Jan-13 7:17 
GeneralRe: how to redirect in a url? Pin
Jassim Rahma18-Jan-13 7:36
Jassim Rahma18-Jan-13 7:36 
GeneralRe: how to redirect in a url? Pin
Parwej Ahamad18-Jan-13 17:23
professionalParwej Ahamad18-Jan-13 17:23 
AnswerRe: how to redirect in a url? Pin
Rekhash18-Jan-13 23:01
Rekhash18-Jan-13 23:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.