errorhandling with response.redirect

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Roel (vdbroel_at_pandora.be)
Date: 06/24/04


Date: Thu, 24 Jun 2004 15:40:46 +0200

Hello

When I have an exception within a try - catch block, I sent the user to my
error page with the following code:
Response.Redirect(@"error.aspx?errmsg=" + ex.Message + "&errsource=" +
ex.Source + "&errstack=" + ex.StackTrace);

The problem is that when there is an \n - sign in the error message or
stacktrace, I get the error "Redirect URI cannot contain newline characters"

Is there anybody who knows how I can transform the "ex.Message" into a
@string or is there another way to solve this problem

Regards
Roel



Relevant Pages

  • Re: Can i pass a SqlConnection object with opened connection to a method/function as a parameter?
    ... This line of code generates the exception: ... short from the ExecuteScalar ... > possibility of a SQL injection attack by using string concatenation ...
    (microsoft.public.dotnet.framework)
  • Re: Starting default mail program
    ... Public Sub StartDefaultMail(_ ... ByVal As String, _ ... Catch ex As Exception ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Unknown Exception
    ... You need a localized device or English device with this locale supported. ... Best regards, ... >I created a sample app in VS2005 and it actually shows the exception ... > DeviceApplication1.Program.Main\r\n" string ...
    (microsoft.public.dotnet.framework.compactframework)
  • Errorhandling with response.redirect
    ... When I have an exception within a try - catch block, I sent the user to my ... Is there anybody who knows how I can transform the "ex.Message" into a ... @string or is there another way to solve this problem ... Regards ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Detailed ASP.Net info not displaying in browser
    ... HTTP 500 page when an exception is thrown from the web service. ... at VOSE.Data.DataRequest.dr_DB2Process.DeleteCommRows(String company, String ... objQueue, tOrderManagementIndicator omindicator, Int32 intTriggerId) in ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.xml)