Ask a Question related to ASP.NET General, Design and Development.
-
twahl #1
Ignore exception in Application_Error event but maintain state
Hi,
I would like to ignore a certain exceptions in
Application_Error event in Global.asax.cs file and still
have the page's state be maintained. If I simply issue:
Server.ClearError()
I end up with a blank page. If I issue:
Server.ClearError();
Response.Redirect(Request.UrlReferrer.ToString());
I end up with the page that I want to be displayed but
it's state (TextBox's have been cleared) is lost.
Thanks for your help,
Terry
twahl Guest
-
#32101 [Com]: Exception in unknown on line 0 when throwing exception inside exception handler
ID: 32101 Comment by: dhopkins at DonHopkins dot com Reported By: ceefour at gauldong dot net Status: No... -
ASP.NET 2 Treeview does not maintain state
I am new to ASP.NET so please bear with me.... I have a treeview in which the nodes are populated from a database. When I click on a node, some... -
Application_error & web services
Hi all, I am practically tearing my hair out here!! In my global.asax file, I have in the Application_error() sub a call to a sub in a library... -
maintain the state of a hidden html control.
Hi, I have a usercontrol which handles the menu functions which is included in the main form.My requirement is to pass a variable to the server... -
Application_Error event and 404 error?
I implemet in Application_Error event in Global.asax, So now when some error occurs in application it send me email, the problem is that it consider... -
Alvin Bruney #2
Re: Ignore exception in Application_Error event but maintain state
what you need to do is catch the error before it bubbles up to the
application level then you won't have all these problems.
"twahl" <terry_wahl@msn.com> wrote in message
news:007201c33c0e$aa1d4700$a601280a@phx.gbl...> Hi,
> I would like to ignore a certain exceptions in
> Application_Error event in Global.asax.cs file and still
> have the page's state be maintained. If I simply issue:
>
> Server.ClearError()
>
> I end up with a blank page. If I issue:
>
> Server.ClearError();
> Response.Redirect(Request.UrlReferrer.ToString());
>
> I end up with the page that I want to be displayed but
> it's state (TextBox's have been cleared) is lost.
>
> Thanks for your help,
> Terry
Alvin Bruney Guest
-
Tian Min Huang #3
RE: Ignore exception in Application_Error event but maintain state
Hi Terry,
Based on my experience, we are not able to keep page's state after calling
Server.ClearError(). To work around this problem, I suggest you to use
structured exception (with try/catch/finally blocks) within your ASP .NET
application.
In addition, I recommend you the following articles on handling exception
in ASP .NET:
An Exception to the Rule, Part 1
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/ht[/url]
ml/asp07232001.asp
An Exception to the Rule, Part 2
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/ht[/url]
ml/asp08232001.asp
Hope this helps.
Regards,
HuangTM
This posting is provided "AS IS" with no warranties, and confers no rights.
Tian Min Huang Guest



Reply With Quote

