473,395 Members | 1,460 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.

custom errors definitions

If I define a custom error definition in the web.config for an asp.net web
site, e.g.

<customErrors mode="On" defaultRedirect="Error.aspx"/>

If an exception in the code causes the error.aspx page to be displayed, is
it possible to get that exception from the Page_Load of the error.aspx page?

Cheers in Advance

Ollie
Nov 18 '05 #1
2 941
You can use Server.GetLastError() to get the last exception thrown.
"Ollie" <ol**********@hotmail.com> wrote in message
news:ec**************@tk2msftngp13.phx.gbl...
If I define a custom error definition in the web.config for an asp.net web
site, e.g.

<customErrors mode="On" defaultRedirect="Error.aspx"/>

If an exception in the code causes the error.aspx page to be displayed, is
it possible to get that exception from the Page_Load of the error.aspx
page?

Cheers in Advance

Ollie

Nov 18 '05 #2
Hi,

you can write Session variable in Global.asax file and get that session in
customerror page.

event in global.asax file is
protected void Application_Error(Object sender, EventArgs e)

{

}

I hope this will help you,

Harshdeep Mehta

"Ollie" <ol**********@hotmail.com> wrote in message
news:ec**************@tk2msftngp13.phx.gbl...
If I define a custom error definition in the web.config for an asp.net web
site, e.g.

<customErrors mode="On" defaultRedirect="Error.aspx"/>

If an exception in the code causes the error.aspx page to be displayed, is
it possible to get that exception from the Page_Load of the error.aspx page?
Cheers in Advance

Ollie

Nov 18 '05 #3

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

Similar topics

4
by: Thomi Richards | last post by:
Hi, I'm trying to create a simple stack class using C++ and templates. Everything works well and good if I amke the class totally inline. However, as soon as I try to seperate the class into a...
17
by: Steve Jorgensen | last post by:
If you've ever employed custom error numbers and messages in you programs, you've probably ended up with code similar to what I've ended up with in the past something like... <code> public...
7
by: Steve Jorgensen | last post by:
Here is some code to generate code for raising and getting information about custom errors in an application. Executing the GenerateXyzErrDefs procedure generates the code. <tblXyzError>...
3
by: Jared | last post by:
Hi, Can someone explain the basic structure of a header file? I just completed a introductory C programming class. The course stressed structured programming and creating reusable code. We...
24
by: Massimo Soricetti | last post by:
Hello, I'm not a C newbie, but I'm teaching C programming (well... FIRST programming and then C) to other guys these days and it's driving me to some reflexions on the language. It's not...
1
by: Bret Pehrson | last post by:
I've converted a non-trivial C++ library to managed, and get the following unhelpful linker error: Assignment.obj : error LNK2022: metadata operation failed (80131195) : Custom attributes are...
8
by: yossi.kreinin | last post by:
Hi! When are multiple definitions of global variables with the same name considered legal in C, and how is it different from C++? It appears that in terms of assembly language, some C...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.