473,398 Members | 2,120 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,398 software developers and data experts.

Page reference in custom IExceptionHandler

Hi misters,

I have an application web (asp.net) and I want define custom Handler for
exceptionhandling (Enterprise Library)

My custom class..
[ConfigurationElementType(typeof(CustomHandlerData) )]
public class GestorExcepcionesIU : IExceptionHandler
I want to do like this:

Exception IExceptionHandler.HandleException(Exception exception, Guid
handlingInstanceId)
{
RegisterStartupScript(@@@PAGE@@@, "jsExcepcionIU",
"alert('Error IU: " + exception.Message.Replace("'", " ") + "');");
return exception;
}

How I get reference of Page in the custom handler ?

Any help will be appreciated, and I'll be very grateful. Thanks in advance.
Greetings, regards.

--
http://www.alhambra-eidos.es/web2005/index.html
www.kiquenet.net
http://www.setbb.com/putainformatica...opic.php?p=843
www.trabajobasura.com/solusoft

Nov 13 '07 #1
3 1661
Is what you need avaible from HttpRequest.Current? Perhaps on the
..Request?

Alternatively there is the Page.Error event and Page.OnError()
method - you might be able to do something with those?

Marc
Nov 13 '07 #2
Thanks mister.

I can access to context like this:

HttpContext.Current.Request

but I haven't page reference :(

Any ideas.

"Marc Gravell" wrote:
Is what you need avaible from HttpRequest.Current? Perhaps on the
..Request?

Alternatively there is the Page.Error event and Page.OnError()
method - you might be able to do something with those?

Marc
Nov 13 '07 #3
At a push, cast the .Handler to a Page? since the Page is indeed the
handler... not very elegant, but worth a shot

Page page = HttpContext.Current.Handler as Page;
if (page != null) {
// do something
}

Marc
Nov 13 '07 #4

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

Similar topics

0
by: cgmoore | last post by:
I added the Exception Handling Application Block to a project I am working on and I've created a type that implements IExceptionHandler to serve as a custom handler. When I try to set the TypeName...
3
by: Joe Bloggs | last post by:
Does anyone know if its possible to pass parameters or the values of Request.QueryString from a web page to a custom control class? I'm using a C# Web Application. For Example I have Web Page1...
7
by: moondaddy | last post by:
I have a products catalogue that I'm putting online and there will be between 20 to 50 different pages of products. Each page contains a datagrid of products for a given category. However, the...
6
by: John Lau | last post by:
Hi, I am looking at the MS KB Article 306355: HOW TO: Create Custom Error Reporting Pages in ASP.NET by Using Visual C# .NET This article describes how to redirect errors to a custom html...
2
by: James Doran | last post by:
Hello, I'd like to iterate through each Page of my ASP.NET project from within a Custom web control and access the Page.Controls collection. I've tried using Reflection on the web project...
1
by: Mike Kline | last post by:
Hi There! How do I make the Objects in the custom made HttpModule available to ASPX page or ASCX controls without requiring an object reference? For example, SessionState HttpModule made the...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
3
by: Alex Maghen | last post by:
Hi. I'm a little confused about the code that resides in the code-behind of a MasterPage and the code that resides in the code-behind of the actual pages that USE that MasterPage. I'm noticing,...
1
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi misters, I have an application web (asp.net) and I want define custom Handler for exceptionhandling (Enterprise Library) My custom class.. public class GestorExcepcionesIU :...
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...
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
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...
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.