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 🙂

Steve Novoselac's avatar

By Steve Novoselac

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

Leave a comment

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