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

Can you force .NET to use browser errors?

Hi,

- I'm running .NET framework 1.1 on win2k server

I'm investigating error pages at the moment. I have found how to:

a) display friendly or real .NET errors in the remote browser, by
editing the "customErrors" section of the machine.config (or
web.config) and setting the value to "On", "Off" or "RemoteOnly".

b) display a custom error file, by adding the "defaultRedirect" entry
to the "customErrors" section and pointing them at custom page for
each type of error, e.g. an error 404 and 500 page.

What i can not seem to do is force a .NET application to use Internet
Explorers error pages, i.e. what you would get with .asp if you have
the browser setting "friendly errors on" ticked.

Does anyone know a way of forcing .NET to use the actual browser error
pages, as generated by "shdoclc.dll"?

I can almost achieve what i desire by adding this entry to the
machine.config:

<customErrors mode="RemoteOnly"
defaultRedirect="res://C:\WINNT\System32\shdoclc.dll/dnserror.htm">
<error statusCode="404"
redirect="res://C:\WINNT\System32\shdoclc.dll/dnserror.htm"/>
</customErrors>

This forces IE to display the desired error page, but i'm not going to
use this method as it relies on users local configration (the location
of the .dll). Any way to force .NET to do this work?

Any help would be greatly appreciated, i can't seem to find any
articles relating to this.
Nov 17 '05 #1
3 2261
ASP.Net runs on the server. You can't force anything to happen on the client
using pure server-side scripting.

....and what are you going to do about non-IE clients?

Cheers
Ken
"Stuart Read" <st********@totalise.co.uk> wrote in message
news:b3**************************@posting.google.c om...
: Hi,
:
: - I'm running .NET framework 1.1 on win2k server
:
: I'm investigating error pages at the moment. I have found how to:
:
: a) display friendly or real .NET errors in the remote browser, by
: editing the "customErrors" section of the machine.config (or
: web.config) and setting the value to "On", "Off" or "RemoteOnly".
:
: b) display a custom error file, by adding the "defaultRedirect" entry
: to the "customErrors" section and pointing them at custom page for
: each type of error, e.g. an error 404 and 500 page.
:
: What i can not seem to do is force a .NET application to use Internet
: Explorers error pages, i.e. what you would get with .asp if you have
: the browser setting "friendly errors on" ticked.
:
: Does anyone know a way of forcing .NET to use the actual browser error
: pages, as generated by "shdoclc.dll"?
:
: I can almost achieve what i desire by adding this entry to the
: machine.config:
:
: <customErrors mode="RemoteOnly"
: defaultRedirect="res://C:\WINNT\System32\shdoclc.dll/dnserror.htm">
: <error statusCode="404"
: redirect="res://C:\WINNT\System32\shdoclc.dll/dnserror.htm"/>
: </customErrors>
:
: This forces IE to display the desired error page, but i'm not going to
: use this method as it relies on users local configration (the location
: of the .dll). Any way to force .NET to do this work?
:
: Any help would be greatly appreciated, i can't seem to find any
: articles relating to this.
Nov 17 '05 #2
I've been doing some more experimentation and I think my original
question was a little off the mark, sorry for this.

Seems that the IE generated error pages are only displayed when the
browser does not get a response from the server, or the server isn't
IIS. For example, browse a non existant url and you get IE's "not
found" error. However, browse for a non-existant page on an existing
IIS hosted site, and you get the IIS "404b" file. This IIS file is
stored on the web server c:\winnt\help\iisHelp\Common\404b.htm.

Now .. .NET "customErrors" only works if you set the "redirect" to a
URL, it will not work with a UNC path.

Any idea how we can get .NET to use these IIS error pages, without
having to copy them into a website and then supply that URL to the
machine.config "customErrors" section?
Nov 17 '05 #3
Add a virtual directory that points to %systemroot%\help\iisHelp\common\

(you should already be able to see this if you have a look at the "default
website" - there's a virtual directory called "IISHelp" that's mapped, which
is how the 500-100 error handler page works for Classic ASP errors).

For additionally sites, you get the "default" response, not the files from
the iisHelp folder - you need to add a similar virtual directory.

Cheers
Ken

"Stuart Read" <st********@totalise.co.uk> wrote in message
news:b3**************************@posting.google.c om...
: I've been doing some more experimentation and I think my original
: question was a little off the mark, sorry for this.
:
: Seems that the IE generated error pages are only displayed when the
: browser does not get a response from the server, or the server isn't
: IIS. For example, browse a non existant url and you get IE's "not
: found" error. However, browse for a non-existant page on an existing
: IIS hosted site, and you get the IIS "404b" file. This IIS file is
: stored on the web server c:\winnt\help\iisHelp\Common\404b.htm.
:
: Now .. .NET "customErrors" only works if you set the "redirect" to a
: URL, it will not work with a UNC path.
:
: Any idea how we can get .NET to use these IIS error pages, without
: having to copy them into a website and then supply that URL to the
: machine.config "customErrors" section?
Nov 17 '05 #4

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

Similar topics

4
by: Kevin Muenzler, WB5RUE | last post by:
How do I force a browser to download a file instead of displaying it? In other words I have a page with MP3 and WMA files on it and I would like for the visitor to download the file instead of...
3
by: Lucvdv | last post by:
I want to return a 404 response from an ASP script (IIS 5). Response.Status lets me set the response string, but if I don't include any HTML text myself, the result is an empty page. Is there...
6
by: Tim Cowan | last post by:
Hi I have the following code to write an error file and it is supposed to open the HTML file in a browser when an error occurs. It creates the file Ok but doesn't open the new browser and doesn't...
4
by: Richard Wilde | last post by:
How do I force an XML document to be downloaded from a web browser to a client? The XML document will come ideally from a dataset but if this is not possible then I can save off the XML document...
8
by: CJM | last post by:
What is the best way to force a page break when printing from a browser? A page in my application generates a series of tables which are usually less than will fit on a page of A4. Ideally I want...
3
by: Dean Slindee | last post by:
My project is getting a bit large, and I would like to kick-start VS05 into performing the error-checking compilation at my direction, rather than waiting for it to self-start. Is there a way to...
0
by: jinnareddy | last post by:
Hi, I'm unable to download a file that is having a 2-byte char in its name (e.g.テ) using force download option. Though, am able to download file names involving ASCII chars. I have tried URL...
27
by: David Golightly | last post by:
This is just a quick poll for all you web devs out there: What browsers do you test on/are concerned about compatibility with? Obviously, you're going to test on current-generation browsers such...
5
by: MoshiachNow | last post by:
HI, How do I force a browser to open a certain file with notepad ? <LI><A HREF="D:/Program Files/yohoLogFile.txt.4" ><p style="font-family:font-size: 7pt;"yohoLogFile.txt.4 </A></LI>'; ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.