How to thow a customise exception

Discussion in 'ASP .Net' started by ad, Jun 6, 2005.

  1. ad

    ad Guest

    I throw a exception in codes:
    But the err.Message is all the some whether the error is thrown or not
    How can I throw an error with a particular

    try
    {
    if (Checked())
    {
    throw (new Exception());
    }
    do something.....
    }
    catch (Exception err)
    {
    Label1.Text=err.Message;
    }
     
    ad, Jun 6, 2005
    #1
    1. Advertising

  2. new Exception("Ooops")

    Eliyahu

    "ad" <> wrote in message
    news:...
    > I throw a exception in codes:
    > But the err.Message is all the some whether the error is thrown or not
    > How can I throw an error with a particular
    >
    > try
    > {
    > if (Checked())
    > {
    > throw (new Exception());
    > }
    > do something.....
    > }
    > catch (Exception err)
    > {
    > Label1.Text=err.Message;
    > }
    >
    >
     
    Eliyahu Goldin, Jun 6, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Myers

    How to Customise an ASP 2.0 grid

    Jason Myers, Mar 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    374
    Jason Myers
    Mar 28, 2006
  2. hood
    Replies:
    1
    Views:
    778
    Andrew Thompson
    Dec 30, 2003
  3. Leigh

    Customise Application Icon

    Leigh, Jan 10, 2008, in forum: Java
    Replies:
    7
    Views:
    16,727
    crackmonkeys4hire
    Mar 7, 2009
  4. hunglduc
    Replies:
    4
    Views:
    1,566
    code learner
    Jan 9, 2011
  5. Chris Angelico
    Replies:
    2
    Views:
    374
    John Nagle
    Jul 23, 2011
Loading...

Share This Page