Categories
Geeky/Programming

.NET: Redirect URI cannot contain newline characters.

if you are doing a Response.Redirect, and are seeing this error, try something like this

string url = someUrlWithNewLines;

url.Replace(“nr”, “”)

Response.Redirect(url);

Seems trivial, but I have seen the error crop up many times. Just for kicks I did a Google search on it, and a lot of people are asking about it, but no real answer. So, here it is 🙂

By Steve Novoselac

Director of Digital Technology @TrekBikes, Father, Musician, Cyclist, Homebrewer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.