Asp.net Error Page Email
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 aspnet page lifecycle this site About Us Learn more about Stack Overflow the company Business
Aspnet Page Life Cycle
Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask asp.net error handling Question x Dismiss Join the Stack 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 exception handling in asp.net c# up How to send error info mail, if any error occurred in web application up vote 1 down vote favorite Here the scenario is I have many .aspx pages if any page gives error, it will redirect to an error page Web.config:
Asp.net Custom Error
if their any other error (forbidden, connectionlost, service unavailable etc) then I want to redirect to customErrorPage.apsx. I want to send an email with error information (error pagename, error statusCode) when the custom error page is displayed and later after few minutes it will auto redirect user to login.aspx. I have tried (not working) void Application_Error(object sender, EventArgs e) { ex = (HttpException)Server.GetLastError(); int errorcode = ex.GetHttpCode(); // Response.Redirect("Errorpage.aspx?id='" + errorcode + "'&msg='" + message + "'"); } My custom error page protected void Page_Load(object sender, EventArgs e) { getUrl = HttpContext.Current.Request.Url.ToString(); // string error= HttpContext.Current.Error.ToString(); // HtmlMeta meta = new HtmlMeta(); // HtmlHead head = (HtmlHead)Page.Header; // meta.HttpEquiv = "refresh"; // meta.Content = "10; url=Login.aspx"; // head.Controls.Add(meta); } protected void Page_UnLoad(object sender, EventArgs e) { //send mail function Email.Send("abc@asa.com", "Error Log", "custom error", true); } ALSO let me know if their is any other good way to this asp.net .net c#-4.0 share|improve this question edited Aug 4 '12 at 10:36 marc_s 450k918621027 asked Aug 4 '12 at 10:33 Satinder singh 5,773133173 add a comment| 2 Answers 2 active oldest votes up vote 2 down
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 more about hiring developers or posting ads with us page_error event in asp.net c# Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community asp.net error logging 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 Send
Asp.net Mvc Error Handling
ASP.Net error page to an email address rather than the browser up vote 0 down vote favorite Is there a way to send the standard error page (that comes up when customErrors is set to Off) to a specific email address rather http://stackoverflow.com/questions/11807891/how-to-send-error-info-mail-if-any-error-occurred-in-web-application than to the browser? Instead it would bring up a friendly error 500 custom error page. I got as far as setting a custom error page to send error information gathered from Exception exception = ctx.Server.GetLastError(); in the global.asax but it rarely contains useful information. What I am mostly interested in is the error description, the page in which the error occurred and the line number. I used to get all this information when using classic ASP. If I could get a copy of the http://stackoverflow.com/questions/25521645/send-asp-net-error-page-to-an-email-address-rather-than-the-browser page that would have been displayed to the user had the customErrors been set to 'off' would be ideal. Maybe something as simple as setting customErrors to 'send_to_email_address'. So far I only found complex web.config settings that I don't understand and don't seem to send the information I need. Note that that my website is running on a IIS6 server. Thanks! asp.net custom-errors share|improve this question asked Aug 27 '14 at 7:49 Osprey 46641629 I don't know if there's something better, but worst-case you could always just design a custom error page and send the email in the Page_Load event, or something like that. –Matthew Haugen Aug 27 '14 at 7:52 Check elmah it does what you want. –Leopard Aug 27 '14 at 9:08 I had tried Elmah but documentation is very poor and all the how-to-installs I found did not work. I could not find proper instructions about how to set the web.config file in IIS6. –Osprey Aug 27 '14 at 14:59 add a comment| active oldest votes Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook. Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Browse other questions tagged asp.net custom-errors or as
Latest Articles Latest Tips/Tricks Top Articles Beginner Articles Technical Blogs Posting/Update Guidelines Article Help Forum http://www.codeproject.com/Tips/259139/Send-ASP-NET-formatted-errors-details-via-Email Article Competition Submit an article or tip Post your Blog http://www.c-sharpcorner.com/article/custom-error-handling-in-Asp-Net/ quick answersQ&A Ask a Question View Unanswered Questions View All Questions... C# questions Linux questions ASP.NET questions SQL questions VB.NET questions discussionsforums All Message Boards... Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design asp.net error and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI C# Free Tools Objective-C and Swift Database Hardware & Devices> System Admin Hosting and Servers Java .NET Framework Android iOS Mobile SharePoint Silverlight / WPF Visual Basic Web Development Site Bugs / Suggestions Spam and aspnet page life Abuse Watch features Competitions News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase Research Library CodeProject Stuff communitylounge Who's Who Most Valuable Professionals The Lounge The Insider News The Weird & The Wonderful The Soapbox Press Releases Non-English Language > General Indian Topics General Chinese Topics help What is 'CodeProject'? General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site Map Advertise with us About our Advertising Employment Opportunities About Us Articles » Web Development » ASP.NET » General Tip/TrickBrowse CodeStatsRevisions (8)Alternatives (1) Comments (17) Add your ownalternative version Tagged as ASP.NET Stats 46.6K views21 bookmarked Posted 23 Sep 2011 Send ASP.NET formatted exception details via email Mohammad A Rahman, 9 Oct 2011 CPOL 4.95 (13 votes) 1 2 3 4 5 4.95/5 - 13 votesμ 4.95, σa 1.05 [?] Rate this: Please Sign up or sign in to vote. Ho
Version 0.5.3 Released We want your feedback: Comment Emotions C# Corner Annual Conference 2017 Announced Future of .NET: Why Is .NET Core Important? Must Read: 50 Important Queries In SQL Server C# Corner Contribute An Article A Blog A News A Video A Link An Interview Question Ask a Question TECHNOLOGIES .NET Chapters Internet & Web Oracle String in C# .NET Core Cloud Internet of Things Outsourcing Swift ADO.NET Coding Best Practices iOS PHP TypeScript AJAX Cognitive Services Java Power BI Universal Windows Platform Android Cryptography JavaScript Products Visual Studio Angular 2 Current Affairs JQuery Project Management WCF AngularJS Databases & DBA JSP Python Web Development Architecture Design Patterns & Practices Knockout R Web Services ASP.NET Dynamics CRM Learn C# Corner Robotics & Hardware Windows 10 ASP.NET Core Entity Framework LINQ Security Windows Controls Azure Error Zone Machine Learning Servers Windows Forms Big Data Games Programming Microsoft Office SharePoint Windows PowerShell BizTalk Server GDI+ & Graphics Mobile Development SignalR WPF Bot Framework Google Development Node.js Smart Devices Xamarin C# HoloLens Office Development Software Testing XAML C, C++, MFC How do I OOP/OOD SQL Language XML Career Advice HTML 5 Open Source SQL Server Request a new Category| View All ANSWERS BLOGS VIDEOS INTERVIEWS BOOKS NEWS CHAPTERS CAREER Jobs CODE IDEAS Scroll To Top Reader Level: Article Custom Error Handling in ASP.NET By Amit Kukreja on May 30, 2002 Structured exception handling is a fundamental part of the CLR and provides .Net programmers a great way of managing errors. In addition to CLR exception system, ASP.Net also provides ways of handling errors. 186.6k 0 1 facebook twitter linkedIn google Plus Reddit WhatsApp expand IntroductionStructured exception handling is a fundamental part of the CLR and provides .Net programmers a great way of managing errors. In addition to CLR exception system, ASP.Net also provides ways of handling errors.When a runtime or design-time