Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2005, 05:26 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to catch exceptions in Render methods?

How or is it possible to catch exceptions thrown from Render methods?

I have a series modules for my ASP.NET application, which implements the Render method. All the exception handling is working fine when outside the Render methods. If I set Trace="true" I can see that the Page_Load method is a done chapter before all rendering is done, why I am not sure if it is possible.

Thanks, Jacob.
__________________
Danish audio books for download at http://www.lytenbog.dk (Danske lydbøger til download).
 
Old November 17th, 2005, 06:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I guess this works...
Code:
        protected override void Render(HtmlTextWriter writer)
        {
            try
            {
                base.Render(writer);
            }
            catch(Exception e)
            {
                Response.Write(e.Message);
            }
        }
        ... but is it best practice?

Thanks, Jacob.





Similar Threads
Thread Thread Starter Forum Replies Last Post
exceptions Maxxim BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 October 18th, 2008 12:34 PM
RenderControl and Render methods joxa83 ASP.NET 1.x and 2.0 Application Design 4 August 24th, 2006 08:10 AM
When to use Exceptions kcraft Pro PHP 1 January 15th, 2005 02:37 PM
Web Exceptions dotnetprogrammer VS.NET 2002/2003 0 November 3rd, 2004 03:39 AM
throwing exceptions...!? jacob ASP.NET 1.0 and 1.1 Basics 3 October 9th, 2003 03:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.