Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to redirect in a url?

how to redirect in a url?

Scheduled Pinned Locked Moved ASP.NET
questioncomtutorialannouncement
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jassim Rahma
    wrote on last edited by
    #1

    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

    P R 2 Replies Last reply
    0
    • J Jassim Rahma

      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

      P Offline
      P Offline
      Parwej Ahamad
      wrote on last edited by
      #2

      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

      J 1 Reply Last reply
      0
      • P 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

        J Offline
        J Offline
        Jassim Rahma
        wrote on last edited by
        #3

        but my signin url is :

        mydomain.com/signin

        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

        P 1 Reply Last reply
        0
        • J Jassim Rahma

          but my signin url is :

          mydomain.com/signin

          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

          P Offline
          P Offline
          Parwej Ahamad
          wrote on last edited by
          #4

          No Url will be: mydomain.com/signin/?returnurl=www.mydomain.com/myprofile/comment/post-guid-string

          Parwej Ahamad

          1 Reply Last reply
          0
          • J Jassim Rahma

            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

            R Offline
            R Offline
            Rekhash
            wrote on last edited by
            #5

            protected void Page_Init(object sender, EventArgs e) { Response.Redirect("~/yourpage.aspx"); }

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups