Asp Net Custom Error Page Vb
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 asp net c++ Learn more about Stack Overflow the company Business Learn more about hiring developers asp net java or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack web config custom error page Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up VB.NET Custom Errors Messages up vote 0 down http://www.asp.net/web-forms/overview/older-versions-getting-started/deploying-web-site-projects/displaying-a-custom-error-page-vb vote favorite I like to user custom errors in my site. The Idea is to trap errors and display friendly meaningful messages to users. The real error details (line number, Page ...) will sent to me by e-mail. I am programming in VB.NET. Until now every code that i found about this say's that i must use the global.asax for it. I do not like to use http://stackoverflow.com/questions/3975786/vb-net-custom-errors-messages global.asax, I just like to make an error page that will sent me a -email with all the error details. Until now, i go to the web.config file and insert this line:
Offending URL: " & ctxOBJ.Request.Url.ToString() & _ "
Source: " & exceptionOBJ.Source.ToString() & _ "
Message: " & exceptionOBJ.Message.ToString() & _ "
Stack trace: " & exceptionOBJ.StackTrace.ToString() & _ "
Target Site: " & exceptionOBJ.TargetSite.ToString() ctxOBJ.Response.Write (errorInfoTXT) ctxOBJ.Server.ClearError () End Sub
When here is an error in some page its redirect me to test.aspx but not showing any error. Thanks, Roy Shoa. asp.net vb.net exception-handling share|improve this question edited Oct 24 '10 at 6:40 asked Oct 20 '10 at 7:57 Roy Shoa 9191118 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted You just need to change this to Sub Page_Load(sender as Object, e as EventArgs) It's not the error page that's erroring, so its error event never fires. share|improve this answer answered Feb 22 '11 at 15:41
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 Stack Overflow the company Business Learn http://stackoverflow.com/questions/7268109/display-specific-error-message-on-custom-error-page more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping http://www.beansoftware.com/ASP.NET-Tutorials/Custom-Error-Pages.aspx each other. Join them; it only takes a minute: Sign up Display specific error message on custom error page up vote 1 down vote favorite I know it's possible in asp.net to create a custom error page in asp net a web app, by putting the following line in the web.config:
ASP.NET Telecommute Jobs Free IP Location Lookup Test .Net Regular Expressions CSS/Table/DIV Page Layouts Custom Programming Article Sites Master List Articles dev.beansoftware.com ASP.NET Tutorials ASP.NET FAQ T-SQL FAQ HTML/CSS FAQ .NET Windows Forms General .NET Framework Freelance Tutorials Web Domains Accepting Credit Cards Anti Spam Home Shop Advertise Write For Us Affiliate Newsletter Contact Custom Error Pages In ASP.NET This tutorial is part of series that covers error handling in ASP.NET. You can find additional information on: * Errors And Exceptions In ASP.NET - covers different kinds of errors, try-catch blocks, introduces Exception object, throwing an exception and page_error procedure. * Application Level Error Handling in ASP.NET - goes a level higher and explains handling of unhandled errors by using Application_Error procedure in Global.asax file, using of custom Http modules, sending notification e-mail to administrator, show different error pages based on roles and logging errors to text files, database or EventLog. This tutorial deals with user experience when error occurs. When error is occurred on ASP.NET web application, user will get default error page (which is not so nice looking, also known as "Yellow screen of death"). This error page confuses average visitor who don't know the meaning of "Runtime Error". Although developers like to know many details about an error, it is better to show more friendly error page to your users. Web.config file contains a customErrors section inside