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.Redirect corrupting redirect URL

Response.Redirect corrupting redirect URL

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelptutorialquestion
4 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.
  • R Offline
    R Offline
    redfish34
    wrote on last edited by
    #1

    I am trying to Response.Redirect to another web application but ASP.NET keeps corrupting the URL. Example, if i am at "http://localhost/application1/main.aspx" and i do redirect to "http://localhost/application2/default.aspx" the redirected url will become "http://localhost/http://localhost/application2/default.aspx". It is as if ASP.NET is guessing that i am redirecting using partial URL, but i am not. How does one fix this?

    N D 2 Replies Last reply
    0
    • R redfish34

      I am trying to Response.Redirect to another web application but ASP.NET keeps corrupting the URL. Example, if i am at "http://localhost/application1/main.aspx" and i do redirect to "http://localhost/application2/default.aspx" the redirected url will become "http://localhost/http://localhost/application2/default.aspx". It is as if ASP.NET is guessing that i am redirecting using partial URL, but i am not. How does one fix this?

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      redfish34 wrote:

      ASP.NET keeps corrupting the URL

      ASP.NET is not corrupting it, you are just not using the tools correctly. How are you making the redirect call?


      I know the language. I've read a book. - _Madmatt

      R 1 Reply Last reply
      0
      • R redfish34

        I am trying to Response.Redirect to another web application but ASP.NET keeps corrupting the URL. Example, if i am at "http://localhost/application1/main.aspx" and i do redirect to "http://localhost/application2/default.aspx" the redirected url will become "http://localhost/http://localhost/application2/default.aspx". It is as if ASP.NET is guessing that i am redirecting using partial URL, but i am not. How does one fix this?

        D Offline
        D Offline
        doudoufly
        wrote on last edited by
        #3

        If you wanna redirect to another web application url. you need add "http://" at the beginning. Response.Redirect("http://localhost/application2/default.aspx");

        1 Reply Last reply
        0
        • N Not Active

          redfish34 wrote:

          ASP.NET keeps corrupting the URL

          ASP.NET is not corrupting it, you are just not using the tools correctly. How are you making the redirect call?


          I know the language. I've read a book. - _Madmatt

          R Offline
          R Offline
          redfish34
          wrote on last edited by
          #4

          In the click event of a form button i have VB "Response.Redirect(url string)" It is really quite simple. The string i pass is what i described in my initial posting, it is a complete "http://" string. It appears that ASP.NET and/or the IIS server is disregarding the "http://" part and assuming that i am making a relative reference and so adds the redirect url to the server root url, as i describe in my initial post. I tried doing workaround by calling a html web form and use javascript to automatically submit it and the form submit creates the same url corruption. Funny thing about this, this redirect url corruption only occurs when calling different web applications that are in the same domain, such as "http://server1/application1" and "http://server1/application2". If i call a web application on "http://server2/" instead of "http://server1/" i do not experience this. As i mentioned, the corruption does not occur all the time, but frequently enough to be a major issue. So far i have found no solution or workaround. I may have to contact Microsoft technical support on this one.

          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