G
gnewsgroup
In a web application, we do not have access to the Console.
And quite often, in order to share a class across the entire web
application, we put it under App_Code.
Normally, classes placed under App_Code do not inherit
System.Web.UI.Page, and therefore do not have access to Response.Write
or any of our Web controls.
Nor do we have a console.
So, here is my question: How do we handle exceptions thrown from, for
example, App_Code\MyClass.cs ?
Should we say something like below?
try
{
// blah blah
}
catch(SqlException se)
{
throw new Exception(se.Message);
}
Thank you!
And quite often, in order to share a class across the entire web
application, we put it under App_Code.
Normally, classes placed under App_Code do not inherit
System.Web.UI.Page, and therefore do not have access to Response.Write
or any of our Web controls.
Nor do we have a console.
So, here is my question: How do we handle exceptions thrown from, for
example, App_Code\MyClass.cs ?
Should we say something like below?
try
{
// blah blah
}
catch(SqlException se)
{
throw new Exception(se.Message);
}
Thank you!