0% found this document useful (0 votes)
53 views2 pages

AvdASPNetLab1 CustomError1

This document outlines the creation of a custom error page demo site. It includes creating default and generic error pages, as well as pages for no access and file not found errors. The web config file is configured to redirect different error codes to the appropriate custom error pages using the <customErrors> element.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views2 pages

AvdASPNetLab1 CustomError1

This document outlines the creation of a custom error page demo site. It includes creating default and generic error pages, as well as pages for no access and file not found errors. The web config file is configured to redirect different error codes to the appropriate custom error pages using the <customErrors> element.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

+ Create WebSite : DemoCustomError

+ Default.aspx

using using using using using using using using using

System; System.Data; System.Configuration; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Response.Write("Connection String : "+ ConfigurationManager.ConnectionStrings["strcn"].ToSt ring()); } }

+ Create WebForm : GenericError.aspx + Create WebForm : NoAccess.aspx + Create WebForm : FileNotFound.aspx + Create Web.Congig =

<?xml version="1.0"?> <configuration> <appSettings/> <connectionStrings/> <system.web> <compilation debug="false" /> <authentication mode="Windows" /> <customErrors mode="On" defaultRedirect="GenericError.aspx"> <error statusCode="403" redirect="NoAccess.aspx" /> <error statusCode="404" redirect="FileNotFound.aspx" /> </customErrors> </system.web> </configuration>

You might also like