| |

VerySource

 Forgot password?
 Register
Search
View: 730|Reply: 4

How do I customize the error message?

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-24 21:20:01
| Show all posts |Read mode
ie When the resource to be accessed does not exist, it often provides the following error message:

Server error in "/ GILSH_WebSite" application.


Could not find resource.
Explanation: HTTP 404. The resource you are looking for (or one of its dependencies) may have been removed, or its name has been changed, or is temporarily unavailable. Please check the following URL and make sure it is spelled correctly.

Requested URL: /GILSH_WebSite/Body/Main/MaxWindow.aspx

How to replace the above tips with your own defined information?
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-2-11 23:15:01
| Show all posts
<customErrors mode = "Off" defaultRedirect = "Main / Err.aspx? ErrType = 1">
<error statusCode = "403" redirect = "NoAccess.htm" />
<error statusCode = "404" redirect = "Main / Err.aspx" />
</ customErrors>
Reply

Use magic Report

0

Threads

15

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-2-13 14:15:01
| Show all posts
correct
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-4-19 21:00:01
| Show all posts
Sorry, ask again: Where should I put my custom error message page myerror.aspx? I created an err directory, put myerror.aspx in it, and browsed the aspx file in another directory, it didn't work.

web.config is as follows:

<customErrors mode = "Off" defaultRedirect = "Main / Err.aspx? ErrType = 1">
<error statusCode = "403" redirect = "NoAccess.htm" />
<error statusCode = "404" redirect = "/ err / myerror.aspx" />
</ customErrors>
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-4-20 09:30:01
| Show all posts
I understand:
<customErrors mode = "On" defaultRedirect = "Main / Err.aspx? ErrType = 1">
<error statusCode = "403" redirect = "NoAccess.htm" />
<error statusCode = "404" redirect = "err / myerror.aspx" />
</ customErrors>

Thank you upstairs!

However, the requested page address will still appear in the ie address bar:
http: // localhost: 1959 / gilsh_website / Err / myerror.aspx? aspxerrorpath = / GILSH_WebSite / Body / Main / MaxWindow.aspx

How to hide?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list