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

Using customErrors returns Server Error in '/' Application

I'm using the following entry in my web.config:
web.config
<customErrors mode="On" defaultRedirect="~/CMS/Default.aspx">
<error statusCode="404" redirect="~/CMS/Default.aspx"/>
</customErrors>

And this is in the Global.asax
Global.asax
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs
HttpContext ctx = HttpContext.Current;
string path = ctx.Request.Path.ToString();
ctx.Response.Write(path);
ctx.Server.ClearError();
}

When I test this on my laptop using Visual web express I can see the
Request.Path written in the browser, but when I upload it to my
webserver I get the error:

Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current
custom error settings for this application prevent the details of the
application error from being viewed remotely (for security reasons). It
could, however, be viewed by browsers running on the local server
machine.

I want to use the customErrors and the code inside the global.asax but
how? Why is my webserver returning this message and my local test
isn't?

I dont host my own webserver, the website is hosted by a company and I
have no access to the servers controlpanel.

How can I get this to work?

Apr 11 '06 #1
1 1758
Hi,

If your host server uses port directing for hosting the web site, you can
get "Server Error in '/' Application". Try to use the full address insread
of "~/CMS/Default.aspx" this address.

Have a nice work,

Aytaç ÖZAY
Software Engineer

<kr******@help2hire.com> wrote in message
news:11*********************@i40g2000cwc.googlegro ups.com...
I'm using the following entry in my web.config:
web.config
<customErrors mode="On" defaultRedirect="~/CMS/Default.aspx">
<error statusCode="404" redirect="~/CMS/Default.aspx"/>
</customErrors>

And this is in the Global.asax
Global.asax
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs
HttpContext ctx = HttpContext.Current;
string path = ctx.Request.Path.ToString();
ctx.Response.Write(path);
ctx.Server.ClearError();
}

When I test this on my laptop using Visual web express I can see the
Request.Path written in the browser, but when I upload it to my
webserver I get the error:

Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current
custom error settings for this application prevent the details of the
application error from being viewed remotely (for security reasons). It
could, however, be viewed by browsers running on the local server
machine.

I want to use the customErrors and the code inside the global.asax but
how? Why is my webserver returning this message and my local test
isn't?

I dont host my own webserver, the website is hosted by a company and I
have no access to the servers controlpanel.

How can I get this to work?

Apr 11 '06 #2

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

Similar topics

6
by: Samuel | last post by:
A few (not all) of my clients are getting this error with a web thumbnail generator code I wrote ============================= Runtime Error Description: An application error occurred on the...
6
by: John Smith | last post by:
I am trying to implement custom error pages and I get this error message: **************************************************************************** ********...
21
by: nicholas | last post by:
Although in my web.config I have <customErrors mode="off" /> I still get no detailed errors. How comes ? THX This is what I get: Server Error in '/mywebfolder'Application.
1
by: Chumley Walrus | last post by:
I'm having trouble seeing my page when I publish it on my live server. I created a project in VS.net (with MMIT integrated), created a simple index.aspx mobilewebform page , I can see it in my...
5
by: Savas Ates | last post by:
I have a web application It works well in my local folder.. When i upload it to my web server i got To enable the details of this specific error message to be viewable on remote machines,...
2
by: rmgalante | last post by:
I encrypted my connectionStrings section with the following command. aspnet_regiis -pef "connectionStrings" "C:\Inetpub\wwwroot \MyVirtualDirectory" It worked and I can see that the...
1
by: poifull | last post by:
Hi all, I specified an aspx page in my web.config/customErrors tag to handle any error that might occur. When an exception is thrown, Server.GetLastError() returns null in the error handling...
3
by: Tahir | last post by:
Hi, i am delevoping an ASP.NET website which worked well on my old web host and now working on localhost but now it doesnt works on my new host. i have new registered and ftp the files that...
15
denny1824
by: denny1824 | last post by:
I have a working website. I copied all the files to a new folder in inetpub/wwwroot and then set that folder as a Virtual Directory in IIS. I try going to that site from the new folder and i am...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.