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 get the current url in the code [modified]

How to get the current url in the code [modified]

Scheduled Pinned Locked Moved ASP.NET
questioncomhelptutorial
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.
  • S Offline
    S Offline
    Satish Developer
    wrote on last edited by
    #1

    Hi, i have a requirement like as below. I need to get the current url of the browser in the code.Based on that url the logic will depends. The problem is we are doing URL rewriting in web.config. Original URL - http://mysite.com/test/mypage.aspx URLRewrite - http://mysite.com/site/champ In my code if i use Request.URL i am getting URLRewrite one. But how can i get the original url in mycode ? Please suggest me

    G. Satish

    modified on Friday, October 29, 2010 3:49 AM

    K T 2 Replies Last reply
    0
    • S Satish Developer

      Hi, i have a requirement like as below. I need to get the current url of the browser in the code.Based on that url the logic will depends. The problem is we are doing URL rewriting in web.config. Original URL - http://mysite.com/test/mypage.aspx URLRewrite - http://mysite.com/site/champ In my code if i use Request.URL i am getting URLRewrite one. But how can i get the original url in mycode ? Please suggest me

      G. Satish

      modified on Friday, October 29, 2010 3:49 AM

      K Offline
      K Offline
      kadaoui el mehdi
      wrote on last edited by
      #2

      Did you try

      Request.QueryString

      ?

      1 Reply Last reply
      0
      • S Satish Developer

        Hi, i have a requirement like as below. I need to get the current url of the browser in the code.Based on that url the logic will depends. The problem is we are doing URL rewriting in web.config. Original URL - http://mysite.com/test/mypage.aspx URLRewrite - http://mysite.com/site/champ In my code if i use Request.URL i am getting URLRewrite one. But how can i get the original url in mycode ? Please suggest me

        G. Satish

        modified on Friday, October 29, 2010 3:49 AM

        T Offline
        T Offline
        thatraja
        wrote on last edited by
        #3

        Try this

        string sURL = Request.Url.AbsolutePath;

        thatraja |Chennai|India|


        Brainbench certifications
        Down-votes are like kid's kisses don't reject it :-)
        Do what you want quickly because the Doomsday on 2012 :-)

        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