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. Response and Redirect

Response and Redirect

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorial
3 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.
  • A Offline
    A Offline
    Ani1991
    wrote on last edited by
    #1

    I have 3 pages say A.aspx,B.aspx and C.aspx. Page A and B redirect to common page C.aspx.Now on page C i want to know from which page its redirected to c,I want to do following on page C.aspx if(redirected from A) { print abc } if(redirected from B) { print xyz } I dont know how to catch redirection request.Please post the code in C# asp.net.

    J C 2 Replies Last reply
    0
    • A Ani1991

      I have 3 pages say A.aspx,B.aspx and C.aspx. Page A and B redirect to common page C.aspx.Now on page C i want to know from which page its redirected to c,I want to do following on page C.aspx if(redirected from A) { print abc } if(redirected from B) { print xyz } I dont know how to catch redirection request.Please post the code in C# asp.net.

      J Offline
      J Offline
      jkirkerx
      wrote on last edited by
      #2

      I think it's request.url.referer

      1 Reply Last reply
      0
      • A Ani1991

        I have 3 pages say A.aspx,B.aspx and C.aspx. Page A and B redirect to common page C.aspx.Now on page C i want to know from which page its redirected to c,I want to do following on page C.aspx if(redirected from A) { print abc } if(redirected from B) { print xyz } I dont know how to catch redirection request.Please post the code in C# asp.net.

        C Offline
        C Offline
        chester_it21
        wrote on last edited by
        #3

        detailed explanation of mr.jkirkerx like here may be:

        var prevPage = Page.Request.Url.Referer.ToString();

        if(prevPage == "pageA.aspx")
        {
        Response.Redirect("pageA.aspx",false);
        }
        else
        {
        Response.Redirect("pageB.aspx",false);
        }

        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