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.EventHan dler(this.Page_ Error);
}
// public void Page_Error(Obje ct 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_star t() function).
After that it goes to Application_Err or(), 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_Err or 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*****@hotmai l.com> wrote in message
news:02******* *************** ******@phx.gbl. .. Hi
My code
Global.asax
Application_Sta rt()
{
// Code
// There is possibility of Exception in above Code
}
Applicaton_Erro r()
{
// in the Redirect Page i m displying the Error
Message //from Server.GetLastE rror();
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_Ero rr().
But the page is "not" Transfering to CapError.aspx.
(I tried with Response.Redire ct as well)
I didnt touch WebConfig file.
Could some one please help me out.
Thanks
Kris
.