Thanks a lot..
All my Pages are inherited from a base class.
I tired the below code in base class.
public BasePage()
{
// Page.Init += new
System.EventHandler(this.Page_Error);
}
// public void Page_Error(Object sender,
EventArgs e)
// {
// // Implementation here
// Server.Transfer("caperror.aspx");
// }
Basically for the first time when it is loading the app
it is encountring the exception(it is not executing the
complete appliction_start() function).
After that it goes to Application_Error(), there it
doesnt know any thing about the context of Application...
Still it is not working after adding the event page_error
to base class.
Is there any way i can achieve this :(
Thanks
Kris
-----Original Message-----
By the time Application_Error runs, the page has already
finishedprocessing, so there is no context in which to transfer
the user.
You should handle Page_Error on your page. If all your
pages transfer tothe same page in case of error, I would recommend having
a base class thatall your pages inherit from that handles this event.
"Kris Meher" <me*****@hotmail.com> wrote in message
news:02****************************@phx.gbl... Hi
My code
Global.asax
Application_Start()
{
// Code
// There is possibility of Exception in above Code
}
Applicaton_Error()
{
// in the Redirect Page i m displying the Error
Message //from Server.GetLastError();
Server.Transfer("CapError.aspx");
}
My problem:-
For the "First" time when the application is loaded,
there is possible exception.
After encountring Exception the Asp.net is executing
Application_Erorr().
But the page is "not" Transfering to CapError.aspx.
(I tried with Response.Redirect as well)
I didnt touch WebConfig file.
Could some one please help me out.
Thanks
Kris
.