473,386 Members | 1,819 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,386 software developers and data experts.

web.config inheritance problem

In the web.config folder at the root of my VS project I have the
following section:

<customErrors mode="On">
<error statusCode="404" redirect "404.aspx" />
</customErrors mode>

When access to a non-existent page is made from any aspx file in the
root then this 404.aspx page is execited as required.

However, I now put an aspx page in a subfolder and tried to access a
non-existent page from there and I now get the standard error. The
subfolder does not seem to be inheriting the setting in the web.config
in the parent.

Maybe it is looking for the 404.aspx file to be in the same folder as
the aspx file that generated it.

Any help please!

John L
Nov 19 '05 #1
2 1194
IMO, you forgot to include the path information in the redirect attribute
making it search in the current direcrtory.

Try :

redirect="~/MyCustomErrors/404.aspx" instead...

Patrice

--

"gemel" <jo***@glenavon1.demon.co.uk> a écrit dans le message de
news:9n********************************@4ax.com...
In the web.config folder at the root of my VS project I have the
following section:

<customErrors mode="On">
<error statusCode="404" redirect "404.aspx" />
</customErrors mode>

When access to a non-existent page is made from any aspx file in the
root then this 404.aspx page is execited as required.

However, I now put an aspx page in a subfolder and tried to access a
non-existent page from there and I now get the standard error. The
subfolder does not seem to be inheriting the setting in the web.config
in the parent.

Maybe it is looking for the 404.aspx file to be in the same folder as
the aspx file that generated it.

Any help please!

John L

Nov 19 '05 #2
John,
Works fine for me here, though you can always try "~/404.aspx"

The only other thing I can think of is that the subdirectory in question is
marked as an application or a virtual directory in IIS....what happens if
you use a fake sub-directory?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"gemel" <jo***@glenavon1.demon.co.uk> wrote in message
news:9n********************************@4ax.com...
In the web.config folder at the root of my VS project I have the
following section:

<customErrors mode="On">
<error statusCode="404" redirect "404.aspx" />
</customErrors mode>

When access to a non-existent page is made from any aspx file in the
root then this 404.aspx page is execited as required.

However, I now put an aspx page in a subfolder and tried to access a
non-existent page from there and I now get the standard error. The
subfolder does not seem to be inheriting the setting in the web.config
in the parent.

Maybe it is looking for the 404.aspx file to be in the same folder as
the aspx file that generated it.

Any help please!

John L

Nov 19 '05 #3

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

Similar topics

1
by: Robert | last post by:
I have a server where the main web application (root) is now migrated to 2.0. It's web.config has a line where it adds the system.data.oracleclient in the configuration and assembiles section. ...
9
by: gerry | last post by:
Is there any way to prevent web.config inheritance in nested web applications ? Here is the scenario, a 3rd party asp.net web application installed on an asp.net intranet site :...
3
by: apiringmvp | last post by:
Hey everyone, I have a config file issue. I have a website with a front in and a back end. (eg. http://www.site.com/ and http://www.site.com/admin). They are both written in .NET 2.0 using...
12
by: Ben | last post by:
I have a group of settings that I'd like to have inherited by multiple sites. I'm trying this, but it's not working. wwwroot\group\web.config wwwroot\group\site1\web.config...
0
by: djmc | last post by:
Hi, I am having problems with virtual directories and web.config inheritance. I have read the section titled "Conflicts between settings on virtual and physical directories" at...
2
by: metaperl | last post by:
Inheritance needed in app configuration ============================= I have an ftp server that a number of vendors connect into to upload a file to their directory. In OO terms, we would have ...
3
by: Ralf Ziller | last post by:
I have a ASP.Net application with web.config files in subfolders. This works fine with the Visual Studio development server. But after publication to an IIS6 webserver a config file inside a...
1
by: Samuel R. Neff | last post by:
We have a problem with Web.config inheritance in two of our applications. We have an old app which is poorly written and must be in the root of the server. We have a newer app which runs from a...
4
by: Max2006 | last post by:
Hi, I have the following tags in my root web.config file: <authorization> <allow roles="RoleA,RoleB"/> <deny users="*"/> </authorization> I also have a public folder in my application...
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a app that uses several membership/role providers. I can list these Providers with the code: Dim rootWebConfig1 As Configuration rootWebConfig1 =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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...

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.