New Line Error in URL (URGENT)

  • Thread starter Thread starter Vishal
  • Start date Start date
V

Vishal

Hello,

I have a URL like this:

http://www.bla.com/login.aspx?url=.... ....

now I need to remove the %0a, but it doesnt work. I tried
this:

<code>
Dim strURL as string = Request.QueryString("url")
strURL = Replace(strURL, "%0a", "")
Response.Redirect(Server.URLDecode(strURL))
</code>

However I got this error message in ther response.redirect
line:

System.ArgumentException: Redirect URI cannot contain
newline characters.

Please help me out, because this is urgent for me.

Thanks in advance
 
I have a URL like this:
http://www.bla.com/login.aspx?url=.... ....

now I need to remove the %0a, but it doesnt work. I tried
this:

<code>
Dim strURL as string = Request.QueryString("url")
strURL = Replace(strURL, "%0a", "")
Response.Redirect(Server.URLDecode(strURL))
</code>
The HttpRequest constructor parses the actual query string. The encoded
character %0a is therefore replaced with an actual newline character in the
string you retrieve form the QueryString collection.
To remove the newline character in your redirection url replace \n instead
of %0a.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
 
Back
Top