You enable a custom error page by adding the following element to
the system.web section of your web configuration file:
File: Default.aspx
<%@ Page Language="C#" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
UpdatePanel Error
You can disable custom error pages in the case of an asynchronous postback by adding an AllowCustomErrorRedirect attribute to the ScriptManager tag, like this:
id="sm1"
AllowCustomErrorsRedirect="false"
Runat="server" />
Web.Config