473,395 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Master Pages, Web User Contols and Error Handling OH MY

So here is the desired functionality:

When an error occurs anywhere in my application, I want an error
section on the page to display the error information while still
showing the actual page that the user encountered the error on.

Here is what I have tried:

I have an ASP.Net 2.0 web application. It uses a master page
that has information on it as well as a Web User Control for displaying
error information. By default the web user control is not visible In
order to code the least amount, I am attempting to us the Page_Error
event to populate the Web User Control will the error information and
make it visible.

The problem:
As described in a previous posting - the Page_Error event will
not render the page content by default. (this would accomplish still
showing the user the page where the error was encountered). I can of
course attempt to force the rendering in any of several manners but I
generally receive an error message indicating that
RegisterForEventValidation can only be called during Render. Fine - I
get that and I know I can turn it off and some of the risk around
turning it off.

The Question:
What is everyone else doing? I have to imaging there are other
programmers out here that want to do the least amount of coding with
the best results so I am looking from some feedback on how other people
might have accomplished what I am attempting. :)

Any feedback would be appreciated.

Aug 3 '06 #1
1 2426
When it is an expected error, I catch the exception at an higher level
function and pass the exception to a utility function that displays the
error in Master Page. All my pages are inherited from custom base page
that is inherited from System.Web.UI.Page and my utility function is
placed in custom base page class.

When it is an un expected error, I override OnError in my custom base
page and transfer (Server.Transfer) it to a Error Display ASPX page
that retrieves the error from Server.GetLastError(). Also, The Error
Display page overrides OnError and responses raw HTML page error
message to avoid recursion problem.

Hth,
Ramu

Aug 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: José Joye | last post by:
Hello, I'm currently reading the MS Developing Web applications with c# (and VB.net). In the chapter related to Error management, there is a sample about "Page-Level Error Pages" eg: In my...
5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
14
by: multiformity | last post by:
So I have been working on an opensource project for a while, and decided to really try to make it look better after focusing on the functionality most of this time. Up to now, I have simply used a...
20
by: Alan Silver | last post by:
Hello, In classic ASP, I used to use two include files on each page, one before and one after the main content, to provide a consistent layout across a web site. That way I could just change the...
1
by: LilC | last post by:
I'm creating an application that has a standard layout for all pages. The information that is displayed in the layout will be dynamic based on the user that is logged in. Thus when a page is...
3
by: sqlboy2000 | last post by:
Hi, I've just started playing around with master / detail pages and I'm trying to simply change the detail page displayed in the contentplaceholder control from code behind. I can't seem to find...
2
by: Alec MacLean | last post by:
Hi I've just recently upgraded to VS2005 and started using/learning about the Master Pages. I'd like to know if it is possible to have separate web app projects use the master page(s) from...
4
by: Boris Yeltsin | last post by:
OK, on my Master Page I have a control: <a id="hypTabAccount" href="#" runat="server">Account</a> Now, in the code-behind (Root.master.vb) I can refer to it simply thus: ...
1
by: dixonjm | last post by:
Hi, I am trying to develop an error handling in our asp.net web app. I'm pretty new to Master pages although the concept of master pages had been completed by someone else & works fine. What I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.