how to redirect in a url?
-
I am using this to redirect to comment page:
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:
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
-
I am using this to redirect to comment page:
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:
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
Put your return url into the query string and after login check if you have return url query then to that url or redirect to default page ?ruturnur=your urllllllllllll
Parwej Ahamad
-
Put your return url into the query string and after login check if you have return url query then to that url or redirect to default page ?ruturnur=your urllllllllllll
Parwej Ahamad
but my signin url is :
and the redirect url is:
mydomain.com/myprofile/comment/post-guid-string
so the full url would be something like this (because I am usilg url route mapping):
mydomain.com/signin/www.mydomain.com/myprofile/comment/post-guid-string
which is invalid!
Technology News @ www.JassimRahma.com
-
but my signin url is :
and the redirect url is:
mydomain.com/myprofile/comment/post-guid-string
so the full url would be something like this (because I am usilg url route mapping):
mydomain.com/signin/www.mydomain.com/myprofile/comment/post-guid-string
which is invalid!
Technology News @ www.JassimRahma.com
No Url will be: mydomain.com/signin/?returnurl=www.mydomain.com/myprofile/comment/post-guid-string
Parwej Ahamad
-
I am using this to redirect to comment page:
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:
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