473,769 Members | 5,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

defaultRedirect

I am having trouble with the page redirecting for handling errors. I have
the following in my Web.config file:
<customErrors mode="On" defaultRedirect ="Errs/AppError.aspx">
<error statusCode="404 " redirect="Errs/NotFound.aspx"/>
</customErrors>

When I hit an error, it redirects me to the Errs/AppError.aspx page, and it
shows the original page that generated the error as a parameter in the URL,
but it doesn't show the contents of the custom error page. If I step through
it with the debugger it doesn't even hit the Page_Load event. It does show
the default error page without the details in it, saying that I can create a
custom error page using the defaultRedirect page, but in the URL for
Errs/AppError.aspx

There is only HTML on the AppError.aspx page (other than the Page_Load).

What am I missing?

-Darrin


Nov 18 '05 #1
1 2114
Double check that there is not an error in your CustomError page. I
had that happen before and it really confused me for a while. Pass
the proper parameters to you CustomError page and see what it does.
That might be a good place to start.

Neil
"Darrin J Olson" <da************ @sio.midco.net> wrote in message news:<uC******* *******@TK2MSFT NGP12.phx.gbl>. ..
I am having trouble with the page redirecting for handling errors. I have
the following in my Web.config file:
<customErrors mode="On" defaultRedirect ="Errs/AppError.aspx">
<error statusCode="404 " redirect="Errs/NotFound.aspx"/>
</customErrors>

When I hit an error, it redirects me to the Errs/AppError.aspx page, and it
shows the original page that generated the error as a parameter in the URL,
but it doesn't show the contents of the custom error page. If I step through
it with the debugger it doesn't even hit the Page_Load event. It does show
the default error page without the details in it, saying that I can create a
custom error page using the defaultRedirect page, but in the URL for
Errs/AppError.aspx

There is only HTML on the AppError.aspx page (other than the Page_Load).

What am I missing?

-Darrin

Nov 18 '05 #2

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

Similar topics

1
1401
by: Gary | last post by:
I have the following in my web.config.... <customErrors mode="RemoteOnly" defaultRedirect="Applicationerror.aspx"/> but, my error page does not display. Instead a 'Runtime Error' page displays showing how to setup CustomErrors. I can't see anything wrong with the entry.
6
4138
by: Gary | last post by:
I have the following in my web.config.... <customErrors mode="RemoteOnly" defaultRedirect="Applicationerror.aspx"/> but, my error page does not display. Instead a 'Runtime Error' page displays showing how to setup CustomErrors. However, if I make my error page a .htm page it shows fine. Anyone know why?
21
2722
by: Gary | last post by:
When using an ASPX page for a DefaultRedirect it does not work if the ASPX page has any code in it. If I put ... If Not IsPostBack Then lblMessage.Text = Server.GetLastError.Message End If in the ASPX page it does not display when an unhandled exception is thrown.
1
2410
by: Dave | last post by:
Hi I want to know if it's possible to user Server.GetLastError() in my AppError.aspx below? The GetLastError is not available here and returns null. I'm using Application_Error event to send an email, but I also want to create a custom error page in the AppError.aspx that displays some of the error message. Do I have to preserve the error message in the Application_Error event <customErrors mode="On" defaultRedirect="AppError.aspx"/> ...
0
1172
by: Markus Rytterkull | last post by:
Hi I'm just testing some web stuff and created a errorpage to display nice messages to all users My page that raises the error uses Server.GetLatestError to get the error and store in a session variable My web.config file has a customErrors-tag and uses defaultRedirect to redirect to my errors page It works fine, the error is caught on my page, session variable is set but on the errorpage the session is empty Why is a new session...
2
4375
by: ad | last post by:
I have a customErrors section in Web.config. All error except error 403 and 404, will be redirect to GenericErrorPage.aspx. How can I show the e.Message or some explicit statement according the error type in GenericErrorPage.aspx? ---------------------------------------------------------------------------- ----------------------------------------------------
1
2537
by: Jonas | last post by:
Hi, I've got an ASP.NET application that I would like to use the defaultRedirect attribute of customErrors element to redirect to a custom aspx-page in case of errors. But the page just doesn't get called, instead the default ASP.NET error page is shown. I no Application_Error sub in global.asax.vb so the web.config should rule this. Any tips?
4
6013
by: =?Utf-8?B?TWFyaw==?= | last post by:
I think I am missing something about how to redirect to a certain page when 404 errors occur. I want to redirect to a generic pagenotfound.aspx page. I have the following in web.config: <customErrors mode="RemoteOnly" defaultRedirect="/misc/pagenotfound.aspx"> </customErrors> However, when I enter a non-existent URL I just get the default Page Not Found error page - my pagenotfound.aspx file is not invoked (it works fine if I enter...
0
9583
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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
10210
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10039
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...
0
9860
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...
1
7406
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5297
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3955
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
2814
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.