Catch Exception Error Message

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Catch Exception Error Message

    You can put your code between (try-catch-end try) block in codebehind
    and catch the exception by
    response.write(exception_name.message)

    frank wrote:
    > Is there any way to output an error directly to the HTML in a ASP.NET page
    > when an exception is caught?
    >
    >
    Onur Bozkurt Guest

  2. Similar Questions and Discussions

    1. Catch VideoError exception?
      Is there a way to catch VideoError exceptions thrown by the VideoDisplay class? I've tried wrapping it in try/catch, but it seems to be thrown...
    2. What exception should I catch ??
      I've read somewhere that it's not a good idea (or design) to catch all exception in one (big) catch(Exception e)... but instead catch the...
    3. How to catch COM exception in .Net
      Ok, I do have a COM dll written in C++. Then a web service written in C# is referencing this COM dll. Here everything is fine. Now I have for...
    4. weird stack trace message from exception thrown in catch block
      If I modify my code a bit to set a variable if an exception is caught, then throw the new exception outside of the try/catch block, it seems to...
    5. ASP catch exception
      I use the following code and get the following error message in my ASP page(not .net). Please help try mycode Catch ex As Exception...
  3. #2

    Default Re: Catch Exception Error Message

    try
    {
    // something
    }
    catch (Exception e)
    {
    Label1.Text = e.Message;
    }

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of little things.

    "frank" <frank@frank.com> wrote in message
    news:uymsRZQUDHA.2520@tk2msftngp13.phx.gbl...
    > Is there any way to output an error directly to the HTML in a ASP.NET page
    > when an exception is caught?
    >
    >

    Kevin Spencer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139