Net Display Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about display error message c# asp net Stack Overflow the company Business Learn more about hiring developers or posting ads with
How To Display Error Message In Asp Net Using C#
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is how to show error message in c# web application a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to display an error message in an ASP.NET Web Application [duplicate] up vote
Asp.net Display Error Message To User
3 down vote favorite 1 I have an ASP.NET web application, and I wanted to know how I could display an error message box when an exception is thrown. For example, try { do something } catch { messagebox.write("error"); //[This isn't the correct syntax, just what I want to achieve] } [The message box shows the error] Thank you Duplicate of http://stackoverflow.com/questions/651592/how-to-display-an-error-message-box-in-a-web-application-asp-net-c/651601 c# asp.net custom-errors share|improve this question edited May how to display message box in c# net web application 2 '12 at 16:39 Mr Lister 25.1k85381 asked Mar 16 '09 at 19:00 zohair 98192137 marked as duplicate by tvanfosson, Andrew Hare, TheTXI, BFree, cgreeno Mar 16 '09 at 19:09 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. Duplicate of stackoverflow.com/questions/651592/… –Perchik Mar 16 '09 at 19:03 If you edit the question to link to a duplicate, please put the link at the bottom so it doesn't alter the summary text on the main pages. –Joel Coehoorn Mar 16 '09 at 19:06 @ZOHAIR: You can see your previous questions and their answers at stackoverflow.com/users/70398/zohair –Ramesh Mar 16 '09 at 19:06 ... this is one time when 'Exact Duplicate' isn't going to get any argument. –John MacIntyre Mar 16 '09 at 19:06 That was the point of putting it at the top so people would recognize it as a duplicate and be able to close it more easily. –tvanfosson Mar 16 '09 at 19:07 | show 3 more comments 3 Answers 3 active oldest votes up vote 7 down vote accepted Roughly you can do it like that : try { /
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About
How To Show Exception Message In Asp.net C#
Us Learn more about Stack Overflow the company Business Learn more about hiring
Asp.net Show Error Message Box
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the how to show message box in asp net web application using c# Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to display an error message http://stackoverflow.com/questions/651716/how-to-display-an-error-message-in-an-asp-net-web-application box in a web application asp.net c# up vote 7 down vote favorite 2 I have an ASP.NET web application, and I wanted to know how I could display an error message box when an exception is thrown. For example, try { do something } catch { messagebox.write("error"); //[This isn't the correct syntax, just what I want to achieve] } [The message box shows the error] http://stackoverflow.com/questions/651592/how-to-display-an-error-message-box-in-a-web-application-asp-net-c-sharp Thank you c# asp.net web-applications messagebox share|improve this question edited Mar 16 '09 at 18:46 asked Mar 16 '09 at 18:22 zohair 98192137 add a comment| 8 Answers 8 active oldest votes up vote 11 down vote accepted You can't reasonably display a message box either on the client's computer or the server. For the client's computer, you'll want to redirect to an error page with an appropriate error message, perhaps including the exception message and stack trace if you want. On the server, you'll probably want to do some logging, either to the event log or to a log file. try { .... } catch (Exception ex) { this.Session["exceptionMessage"] = ex.Message; Response.Redirect( "ErrorDisplay.aspx" ); log.Write( ex.Message + ex.StackTrace ); } Note that the "log" above would have to be implemented by you, perhaps using log4net or some other logging utility. share|improve this answer edited Mar 16 '09 at 18:49 answered Mar 16 '09 at 18:25 tvanfosson 352k65571700 Upvoted for saying what I was trying to say. –Bobby Cannon Mar 16 '09 at 18:28 @tvanfosson - It is not that they cannot display message box on server side or client side. They should