New Line Error in URL (URGENT)

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
 
A

Anders Norås [MCAD]

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top