Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: Redirect URI cannot contain newline characters.

Status
Not open for further replies.

AT76

Technical User
Joined
Apr 14, 2005
Messages
460
Location
US
Hi,

I'm trying to redirect to a new page but I'm getting the error I mentioned above. I'm passing strings in my redirect. It seems the problem is when there is an \n - sign in the error message or stacktrace. From research in the web I saw that a fix is:

1)Create a new webform: error.aspx
2)Use Server.Transfer("error.aspx")
3)In the error.aspx page access the error as Server.GetLastError()

This last step is what I did not understand. In error.aspx inside of Page_Load I added "Server.GetLastError()".

I run the code and I do not get an error anymore but I just get a blank page. nothing gets re-directed. Any suggestions?

Thanks!
 
I don't really understand what you are trying to do. Simply calling Server.GetLastError() won't output anything to a page, it will simply get the last error that occurred.

Can you explain why you are attempting to do?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Yes,


I'm trying to do:
Code:
Response.Redirect("ViewICRNumberData.aspx?ICRNum=" +
				ICRNum + "&Originator=" +Originator + "&ICRType=" 
				+ICRType + "&ICRStatus=" +ICRStatus + "&ICRDesc=" 
				+ICRDesc + "&EffUntil=" +EffUntil + "&LogDate=" 
				+LogDate + "&ProdDir=" +ProdDir + "&ProdAnalyst=" 
				+ProdAnalyst + "&ICRStyle=" +ICRStyle + "&TrckgCode="
				+TrckgCode + "&AgreeReturn=" +AgreeReturn + "&AgreePercent="
				+AgreePercent + "&AgreeRestock=" +AgreeRestock + "&AgreeDate="
				+AgreeDate + "&AgreeCost=" +AgreeCost + "&AgreeWarr="
				+AgreeWarr + "&RoutePartAdds=" +RoutePartAdds + "&RoutePartAddsDate="
				+RoutePartAddsDate + "&RouteInvSupe=" +RouteInvSupe + "&NextReview="
				+NextReview + "&DiscDate=" +DiscDate + "&DiscID=" +DiscID + "&ICRComment=" +ICRComment);

The problem sorce is ICRComments. In this case ICRComment is:
Code:
"New FOB SLP Pana-Pacific Program.\r\nMinimum buy 100 pcs each part/one part number\r\n100% return agreement signed.\r\n
Planner notes to planner, PO's generated on 12-22. MWD "

It seems that the '\n' is the cause of the error. Is there a way to avoid this? Thanks!
 
I'd consider no using querystring variables for this tyoe and amount of data. Try using a session variable or post it through a form instead.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I tried using a request.Form instead but got the same error...
 
I decided to take away the carriage returns:
Code:
newString = ICRComment.Replace("\n", " ");
				ICRComment = newString;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top