It would be helpful if you could share us detailed steps to reproduce your issue.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
3 Points
12 Posts
Help on 404 custom
May 01, 2017 12:56 AM|rickyJJ|LINK
"Create a web page (Err404.aspx) with custom error message which will be displayed when a user try to access a non-existing web page"
I created the ERR404.aspx page, now this is code when i add to be web.config file
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="true" />
<!-- Turn on Custom Errors -->
<customErrors mode="On"
defaultRedirect="/nonexistingpage.aspx">
<error statusCode="404" redirect="/Err404.aspx"/>
</customErrors>
</system.web>
</configuration>
Now my end state is to basically test the configuration when the non existing webpage by typing https://localhost/nonexistingpage.aspx
I would appreciate any help on this issues please.
Rickyjj
Contributor
3310 Points
1607 Posts
Re: Help on 404 custom
May 01, 2017 03:04 AM|Edward Z|LINK
What is your issue? What is your project type? Based on your description, it seems to be WebForm.
I made a test with WebForm by following below steps, it works correctly.
1. Add two pages DefaultRedirectErrorPage.aspx and Http404ErrorPage.aspx under Project Folder.
2. Add below configuration.
3. Access http://localhost:2551/DefaultRedirectErrorPage.aspx, it shows DefaultRedirectErrorPage.aspx page
4. Access http://localhost:2551/test.aspx which is not exist, it shows Http404ErrorPage.aspx.
It would be helpful if you could share us detailed steps to reproduce your issue.
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.