S
SMG
Hi ,
Sory for incomplete message in last post here is the actual problem..
I am using following code in web.confiig for trapping all the error through
out my site..
<customErrors mode="On" defaultRedirect="WebForm1.aspx">
<error statusCode="404" redirect="ServerError.aspx"></error>
<error statusCode="500" redirect="WebForm3.aspx"></error>
</customErrors>
It works very fine... but On the final page e.g WebForm3.aspx I want catch
the error and want to show it on the screen.
so i wrote following code in webform3.aspx but it throws an error
// Create an Exception object from the Last error
//that occurred on the server
Exception myError =Server.GetLastError();
// Get the error message
string str = "Error Message :" + myError.Message;
It doesn't work it gives an error at following line
strErrorMsg += "\n\nError Message :" + myError.Message;
Regards,
Shailesh Gajare
Sory for incomplete message in last post here is the actual problem..
I am using following code in web.confiig for trapping all the error through
out my site..
<customErrors mode="On" defaultRedirect="WebForm1.aspx">
<error statusCode="404" redirect="ServerError.aspx"></error>
<error statusCode="500" redirect="WebForm3.aspx"></error>
</customErrors>
It works very fine... but On the final page e.g WebForm3.aspx I want catch
the error and want to show it on the screen.
so i wrote following code in webform3.aspx but it throws an error
// Create an Exception object from the Last error
//that occurred on the server
Exception myError =Server.GetLastError();
// Get the error message
string str = "Error Message :" + myError.Message;
It doesn't work it gives an error at following line
strErrorMsg += "\n\nError Message :" + myError.Message;
Regards,
Shailesh Gajare