By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,726 Members | 2,465 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,726 IT Pros & Developers. It's quick & easy.

Using customErrors returns Server Error in '/' Application

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.