473,883 Members | 1,594 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom Error not working

the customError feature is not working. I have it setup as the help says in
my web.config file.

<customErrors defaultRedirect ="DsAppError.as px" mode="RemoteOnl y"/>

I tried in a couple different parts of my site to throw a dummy exception
and I always get to the page that says change my web.config to the statement
above.
Nov 18 '05 #1
9 13908
try this:

<customErrors mode="Off" defaultRedirect ="DsAppError.as px"/>

m.

--------------
"Nick" <ni**@digitroni cs.com> wrote in message
news:Pj******** ********@newsre ad2.news.pas.ea rthlink.net...
the customError feature is not working. I have it setup as the help says in my web.config file.

<customErrors defaultRedirect ="DsAppError.as px" mode="RemoteOnl y"/>

I tried in a couple different parts of my site to throw a dummy exception
and I always get to the page that says change my web.config to the statement above.

Nov 18 '05 #2
Is the documentation on this feature wrong? If customError is off then
according to the documentation you get a page generated with the error and
stack trace and no custom error pages will be shown.

What I want is for it to work like it says for remoteOnly. I want error and
stack trace info on the development or "local" system and that works fine.
On RemoteOnly I get a generated page with exception information. But on
RemoteOnly on any other machine I get a message saying you can replace this
page with a custom message. Well I have defined that but I do not know why
it doesnt work. If I turn the setting to Off like you suggested then remote
users get error and stack trace information which is not what I want.

"Mohammad Samara" <mo******@samar a.fslife.co.uk> wrote in message
news:uq******** ******@TK2MSFTN GP12.phx.gbl...
try this:

<customErrors mode="Off" defaultRedirect ="DsAppError.as px"/>

m.

--------------
"Nick" <ni**@digitroni cs.com> wrote in message
news:Pj******** ********@newsre ad2.news.pas.ea rthlink.net...
the customError feature is not working. I have it setup as the help says
in
my web.config file.

<customErrors defaultRedirect ="DsAppError.as px" mode="RemoteOnl y"/>

I tried in a couple different parts of my site to throw a dummy

exception and I always get to the page that says change my web.config to the

statement
above.


Nov 18 '05 #3
Hi Nick,
Thank you for using Microsoft Newsgroup service. From your description,
you're wanting to set a custom error page in an ASP.NET web application
which will be shown for the remote client user when error occurs. And you
set the "customErro rs" element as :
<customErrors defaultRedirect ="DsAppError.as px" mode="RemoteOnl y"/>
in the web.config file. However, you found this didn't work. Is my
understanding correct? If anything wrong, please feel free to correct me.

Firstly, I'm sure your original setting as "<customErr ors
defaultRedirect ="DsAppError.as px" mode="RemoteOnl y"/>" is quite correct. So
I do feel abit strange as it doesn't work. Would you please try out the
following tests:

1. change the "mode=" as "On" and see whether it display the custom error
page("DsAppErro r.aspx") both on local or remote client?

2. If still fails to work, I think you may have a check on the error
page("DsAppErro r.aspx"), is it accessable or if there is something
incorrect with the error page? For example, you can try setting the
defaultRedirect page as
defaultRedirect ="http://localhost/appname/DsAppError.aspx " to specify the
full path.

3. If still with no success after the above steps, would you try creating
another simple web application and provide a simple error page and set the
web.config as
"<customErr ors defaultRedirect ="customerrorpa gename" mode="RemoteOnl y"/>"

Also, you may try rebooting the IIS server. Or check the server enviroment.
Please try out the preceding suggestion. If you have any quesions or need
any help, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #4
mode = On

local = My custom page shown but Server.GetLastE rror() returned null
remote = My custom page shown but Server.GetLastE rror() returned null

mode = RemoteOnly

local = Generated page shown with message and stack trace
remote = My custom page shown but Server.GetLastE rror() returned null

mode = Off

local = Generated page shown with message and stack trace
remote = Generated page shown with message and stack trace

Well, I changed a few things and all of a sudden it starts working, well
sort of. Looks like after setting it on and then to RemoteOnly it started
working.

I must be misunderstandin g the help on Server.GetLastE rror().... Why is it
returning null in my DsAppError.aspx code?
Nov 18 '05 #5
I spoke to soon, it has stopped working again. I decided I wanted to show
error information my own way even on the local machine, so I set the
mode="On".

As soon as I did that and I ran the my test page, I was sent to a generated
page telling me to change my web.config file. This is making me crazy.

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:8Z******** ******@cpmsftng xa07.phx.gbl...
Hi Nick,
Thank you for using Microsoft Newsgroup service. From your description,
you're wanting to set a custom error page in an ASP.NET web application
which will be shown for the remote client user when error occurs. And you
set the "customErro rs" element as :
<customErrors defaultRedirect ="DsAppError.as px" mode="RemoteOnl y"/>
in the web.config file. However, you found this didn't work. Is my
understanding correct? If anything wrong, please feel free to correct me.

Firstly, I'm sure your original setting as "<customErr ors
defaultRedirect ="DsAppError.as px" mode="RemoteOnl y"/>" is quite correct. So I do feel abit strange as it doesn't work. Would you please try out the
following tests:

1. change the "mode=" as "On" and see whether it display the custom error
page("DsAppErro r.aspx") both on local or remote client?

2. If still fails to work, I think you may have a check on the error
page("DsAppErro r.aspx"), is it accessable or if there is something
incorrect with the error page? For example, you can try setting the
defaultRedirect page as
defaultRedirect ="http://localhost/appname/DsAppError.aspx " to specify the
full path.

3. If still with no success after the above steps, would you try creating
another simple web application and provide a simple error page and set the
web.config as
"<customErr ors defaultRedirect ="customerrorpa gename" mode="RemoteOnl y"/>"

Also, you may try rebooting the IIS server. Or check the server enviroment. Please try out the preceding suggestion. If you have any quesions or need
any help, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #6
I think I have figured this out. I am using forms authentication which is
the problem.

The first test I made was on the 2nd page after the login page so the user
had logged in, went to my test page and got the test error. At this point
they were redirected to the error page but no matter what
server.GetLastE rror() returned null, not sure why.

I moved the test error to the login page. So when the login page comes up,
the error takes place and is redirected to the DsAppError.aspx but they have
not been authenticated so they are sent back to the Login.aspx but that is
where the error is. I am assuming that something is detecting the circular
page reference and stopping it and telling the user (me) to change the
web.config. But the real problem is the circular page reference.

I am not sure what authentication is the best way. I am taking users to the
login page to ask for user name and password and I am then going to check
that information against a table in SQL Server. It will not be the login to
sql server as that will be a fixed value but will be checked against a data
table.

Is there a better mode basic authentication for this setup than Forms
authentication or can I simply make the DsAppError.aspx a form that does not
recquire authentication?

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:8Z******** ******@cpmsftng xa07.phx.gbl...
Hi Nick,
Thank you for using Microsoft Newsgroup service. From your description,
you're wanting to set a custom error page in an ASP.NET web application
which will be shown for the remote client user when error occurs. And you
set the "customErro rs" element as :
<customErrors defaultRedirect ="DsAppError.as px" mode="RemoteOnl y"/>
in the web.config file. However, you found this didn't work. Is my
understanding correct? If anything wrong, please feel free to correct me.

Firstly, I'm sure your original setting as "<customErr ors
defaultRedirect ="DsAppError.as px" mode="RemoteOnl y"/>" is quite correct. So I do feel abit strange as it doesn't work. Would you please try out the
following tests:

1. change the "mode=" as "On" and see whether it display the custom error
page("DsAppErro r.aspx") both on local or remote client?

2. If still fails to work, I think you may have a check on the error
page("DsAppErro r.aspx"), is it accessable or if there is something
incorrect with the error page? For example, you can try setting the
defaultRedirect page as
defaultRedirect ="http://localhost/appname/DsAppError.aspx " to specify the
full path.

3. If still with no success after the above steps, would you try creating
another simple web application and provide a simple error page and set the
web.config as
"<customErr ors defaultRedirect ="customerrorpa gename" mode="RemoteOnl y"/>"

Also, you may try rebooting the IIS server. Or check the server enviroment. Please try out the preceding suggestion. If you have any quesions or need
any help, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #7
Hi Nick,

Thanks for your response. I'm glad you've figured out the actual problem.
As for the Authenticaion Mode and the "circular page reference" problem you
mentioned. Here is my suggestion:

I think the Form Authentication is a very convenient and flexible means of
authentication since it provide a simple implementation and custom account
checking(via custom database or other user list). The problem cause the
circular page is that the custom error page is authentication protected so
that unauthenticated user we be redirect to login page. I've also used the
FormAuthenticat ion before , and use a common custom error page. My solution
is to set all those common pages such as "register page" , "about page" or
"custom error page", "custom success info page" 's permission as
<alow user="*"> , only set strict permission for certain part of
pages(which may have important infos)
Thus, the unauthenticated users(anonymous ) can also visit those those
common page.
How do you think of this?

In addition, as for the other authentication mode you mentioned, I think
the basic or windows mode may appropriate for the intranet situation. As
for the internet based web application, those no OS dependant
authentication mode such as "Forms" or "Passport" maybe more proper. For
detailed discusion on the Authenticaion mode in ASP.NET , you may view the
following tech articles in MSDN:
#Building Secure ASP.NET Applications: Authentication, Authorization, and
Secure Communication

http://msdn.microsoft.com/library/en...MSDN.asp?frame
=true

Hope it is helpful.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 18 '05 #8
Hi Nick,

Thanks for your response. I'm glad you've figured out the actual problem.
As for the Authenticaion Mode and the "circular page reference" problem you
mentioned. Here is my suggestion:

I think the Form Authentication is a very convenient and flexible means of
authentication since it provide a simple implementation and custom account
checking(via custom database or other user list). The problem cause the
circular page is that the custom error page is authentication protected so
that unauthenticated user we be redirect to login page. I've also used the
FormAuthenticat ion before , and use a common custom error page. My solution
is to set all those common pages such as "register page" , "about page" or
"custom error page", "custom success info page" 's permission as
<alow user="*"> , only set strict permission for certain part of
pages(which may have important infos)
Thus, the unauthenticated users(anonymous ) can also visit those those
common page.
How do you think of this?

In addition, as for the other authentication mode you mentioned, I think
the basic or windows mode may appropriate for the intranet situation. As
for the internet based web application, those no OS dependant
authentication mode such as "Forms" or "Passport" maybe more proper. For
detailed discusion on the Authenticaion mode in ASP.NET , you may view the
following tech articles in MSDN:
#Building Secure ASP.NET Applications: Authentication, Authorization, and
Secure Communication

http://msdn.microsoft.com/library/en...MSDN.asp?frame
=true

Hope it is helpful.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 18 '05 #9
Hi Nick,

Have you had a chance to try out my suggestion or have you resolved the
problem? As for setting different access role for
different page or folder in the web.config I mentioned in the last reply,
I've found a KB article which detailedly focus on this topic, I believe it
will be helpful to you:

#HOW TO: Control Authorization Permissions in an ASP.NET Application
http://support.microsoft.com/?id=316871

If you need any further assistance, please feel free to let me know.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #10

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

Similar topics

3
4184
by: Mark Metzner | last post by:
We currently have custom error logging setup on all of our websites. We have IIS setup to redirect to our custom 500-100.asp page which logs the error to a database and then redirects to a friendly error message page. Last week we were working on a pretty troublesome error on our intranet site and noticed huge discrepencies between the IIS Log and our error log database. On this particular day for this particular site, the IIS Log has...
16
9309
by: Bret Pehrson | last post by:
I've converted a non-trivial C++ library to managed, and get the following unhelpful linker error: Assignment.obj : error LNK2022: metadata operation failed (80131195) : Custom attributes are not consistent: (0x0c0001a5). Display.obj : error LNK2022: metadata operation failed (80131195) : Custom attributes are not consistent: (0x0c000108). The help for LNK2022 is completely useless:
1
4216
by: Tamas Demjen | last post by:
I started to experiment with VC++ 2005 Beta1. So far everything went fine, and already have a working project, but soon I realized that the compiler was ancient (not supporting half of the C++/CLI standard). So I downloaded the VC++ 2005 Tools Refresh (http://tinyurl.com/5mdq2). After that I tried to do a full rebuild, but my project wouldn't link anymore. I get the following errors: MSVCMRTD.lib(mstartup.obj) : error LNK2022: metadata...
0
1693
by: Rhys666 | last post by:
OK, an issue I've come across before, but never found a cause for or resolution of, has decided to become the bane of my life again with ASP.Net Custom Error Pages. Basically, my web application is configured to utilise a custom errors page, in that unhandled exceptions get passed through and the page redirects correctly as per the settings in the web.config file and Global.asax. This works in 95% or so of cases, however... On...
3
2065
by: Mr Newbie | last post by:
I'm testing error handling configurations and having some trouble. I created a WebForm called. ErrDefault.aspx and I am trying to use the Page error attribute to force the redirection to a custom page, but I only get and unhandled exception page and it does not direct me to my specific page. I'm probably doing something really stupid, but I cant see what . Any Ideas ? - Thanx Mr N --------- DETAILS BELOW -----------
2
2606
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a good while and I'm getting really frustrated now! My problem is this - my custom controls periodically disappear from my
6
1593
by: Steve Amey | last post by:
Hi all I want to be able to throw a custom error up the call stack. I have looked around and it seems as though it's possible, but I can't get it to work :o( Below is some sample code. ------------------------------------------------------------ Public Class MainForm Public Sub Show Form Try
2
3570
by: John | last post by:
Hi I was working fine with create user wizard and the default membership provider. I have now customised the membership provider as per attached web.config. The create user wizard picks up the custom membership provider fine and removes the security question/answer fields as designated in the custom provider. The problem is that when I try to create a new user in the create user wizard by entering the info and pressing the 'create...
6
4826
by: Jeff Hegedus | last post by:
I have a dll that requires some configuration data. I put the configuration data in a custom configuration section in a config file that is loaded in the installation folder of the dll. If I install the dll to the same directory as the exe which uses it, everything works as expected but if I load the dll in any other directory, I get the following error... 2007-02-04 16:36:51,171 DEBUG CentrifugeBHO.CentrifugeBHO - dllPath =...
0
9793
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
11151
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
10750
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
10419
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
7974
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
7134
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5996
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4619
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
3237
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.