473,799 Members | 2,997 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What Page threw the exception

I'm in the application_err or event. I want to know which aspx experienced
the exception. Is there any easy way?
Thanks,
G
Nov 18 '05 #1
3 1442
Server.GetLastE rror() will return the last exception thrown, if that helps
at all.

Have you tried somethign like:

Exception ex = Server.GetLastE rror();
strSource = ex.Source;

strSource should then include the name of the object that threw the
exception

- Tom Kiefer
thogek @ earthlink . net
"Gary" <gb@nospam.co m> wrote in message
news:eU******** *****@tk2msftng p13.phx.gbl...
I'm in the application_err or event. I want to know which aspx experienced
the exception. Is there any easy way?
Thanks,
G

Nov 18 '05 #2
Hi Gary,
Thanks for posting in the community! My name is Steven, and I'll be
assisting you on this issue.
From your description, you catched some unhandlered exceptions in the
Global object's "Application_Er ror" event, and you're wanting to get the
source infos of the certain exception,yes?
If there is anything I misunderstood, please feel free to let me know.

Based on my research, I think Tom Kiefer's suggest that use
"Server.GetLast Error();" to retrieve the last thrown exception is quite
correct. You can then get many infos from the Exception object such as:
Exception.HelpL ink ---------Gets or sets a link to the help file associated
with this exception.
Exception.Inner Exception -------Gets the Exception instance that caused the
current exception.
Exception.Messa ge ---------Gets a message that describes the current
exception.
Exception.Sourc e ----------Gets or sets the name of the
application or the object that causes the error
Exception.Stack Trace ----------Gets a string representation of the frames
on the call stack at the time the current exception was thrown.
......

For more detailed info on the System.Exceptio n class, you may view the
reference in MSDN:
http://msdn.microsoft.com/library/en...ExceptionClass
Topic.asp?frame =true

Also, here are some tech articles on handle the application level or page
level exceptions in ASP.NET:
#Handling Application-Level Errors
http://msdn.microsoft.com/library/de...us/dv_vbcode/h
tml/vbtskcodeexampl ehandlingapplic ationlevelerror .asp

#Handling Page-Level Errors
http://msdn.microsoft.com/library/en...deExampleHandl
ingPageLevelErr ors.asp?frame=t rue

I belive they're also helpful to you.
Please check out the above items. If you have any further questions, please
feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3
Hi Gary,
Have you had a chance to check out my suggestion or have you resolved the
problem? If you need any assistance, please feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 18 '05 #4

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

Similar topics

3
19880
by: David Lozzi | last post by:
Hello, I'm receving the following on my webserver (Windows 2003 Server SP1) Event ID: 5 Source: Active Server Pages Error: File /KQShopping/ordercomplete4.asp Script Engine Exception. A ScriptEngine threw exception 'C0000005' in 'IActiveScriptParse::ParseScriptText()' from 'CActiveScriptEngine::AddScriptlet()'.. Event ID: 5 Source: Active Server Pages
1
4319
by: Colin | last post by:
Hi there, I have wrote a simple console app in C# to get the dimensions for a jpeg file /*** Image img = Image.FromFile(@"C:\TEMP\PvFile\1036437.jpg", true); LogEvent("Height = " + img.Height.ToString() + "; Width = " + img.Width.ToString());
0
2184
by: Jonathan G. | last post by:
I'm writing my first windows service. I have a class called 'mainprocess' whose constructor is called by the service class. Within mainprocess, I declare an instance of another class I wrote, called DBHandler, which does all of my Sql Database work. I have LogEvents everywhere and notice that the thread never gets inside the DBHandler constructor. Instead, it throws this error as a new instance of the DBHandler class is declared:...
1
3639
by: Axel Dahmen | last post by:
Hi, I've added a property to my Page base class (this base class inherits from Page and all my aspx.cs classes inherit from my base class). This property of mine uses the Session object to determine its return information. After implementing this property, whenever I now open any aspx page in the Visual Studio 7.0 IDE, the following error shows up: "The file failed to load in the Web form designer. Please correct the
5
15031
by: samuelberthelot | last post by:
Hi, I get this exception when I use a themed css file. In my web.config file I have: <pages theme="dRise"> and the trouble page is a master page : <% Response.Write(Header)%> <form id="form1" runat="server"> <div class="FormContent">
6
13027
by: Aero | last post by:
Hi, My window application written in C# is throwing following exception while connecting to one FTP location The type initializer for System.Net.Sockets.Socket threw an exception This exe is working fine on staging environment, (Window 2003) but after migrating to production environment (Windows 2000), throwing this exception at
0
1981
by: =?Utf-8?B?YmlqYXk=?= | last post by:
The type initializer for 'Microsoft.ApplicationBlocks.Cache.CacheService' threw an exception. We migrated our windows application from 1.1 to 2.0. The debug and Release mode of the application work fine with some tweaking. But when the setup project is migrated to 2.0 the installation gives the follwing error: - <ExceptionInformation> <AdditionalInformationProperty ExceptionManager.MachineName="TestDev"...
4
39707
by: =?Utf-8?B?YmlqYXk=?= | last post by:
We migrated our windows application from 1.1 to 2.0. The debug and Release mode of the application work fine with some tweaking. But when the setup project is migrated to 2.0 the installation gives the follwing error: Message:The type initializer for 'Microsoft.ApplicationBlocks.Cache.CacheService' threw an exception. - <ExceptionInformation>
0
2078
by: Schadrach | last post by:
I'm having a strange problem, I have a small executable that runs a backup for a some data nightly, and as of September 22, 2007 it has ceased to function with the following error: Unhandled Exception: System.TypeInitializationException: The type initializer for "System.Threading.Thread" threw an exception. ---> System.ArgumentOutOfRangeException: Load factor needs to be between 0.1 and 1. Parameter name: loadFactor at...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10252
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10231
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.