Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Application_Error weirdness
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00834941
Message ID:
00835165
Views:
18
>I don't understand why you want to do a ToString() when ToString() only returns you (supposedly) the value of the Message property.
What is so important about using ToString()???

Nope. "Supposedly" is the operant word there <g>.

I mentioned in reply to your message suggesting use of the Message property, (in another thread) it doesn't (as is suggested by the docs) return the same value as ToString().

For instance, if I (for testing purposes) put the following line of code in a btn_Click event:
throw new ApplicationException();
the value returned by the InnerException.Message of the thrown exception is:

"Error in the application"

However, if I retrieve InnerException.ToString(), I get this:

"System.ApplicationException: Error in the application. at AmexCommercial.Search.btnSearch_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\amexcommercial\search.aspx.cs:line 70 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain()"

I'd rather use the ToString() value, wouldn't you? <s>
>>-Steve->>

Steve Sawyer
Geeks and Gurus, Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform