Изменение страницы Unhandled Exception (/_layouts/error.aspx)

? ??????????? ???? ??? ???????? ????? ??????????? ?? MOSS 2007 ? ????????????? ?????? ???? ???????, ??????? ?????? ????? ??????? ????????????, ? ?????? ??? ????? ?????????????? ??????????? ???????? ??????????? ?????? error.aspx

???? ???? ??? ??????????????? ??? ????, ???????? ????, ????????:

?????????????? ???????????? ? ??? ????:

1. ??????????? IHttpModule ? ????????? ??????? Error

2. ??????? ???????? myerrorpage.aspx ? ????? 12\Template\Layouts. ??????? ????? ?????????? ? ???????????? error.aspx

3. ? web.config ? ?????? httpmodules ???????? ??????:

 <httpModules>
<clear />
< addname="ExceptionEventHandler"type="MyProject, MyProject.ExceptionEventHandler,
Version=1.0.0.0, Culture=neutral,PublicKeyToken=34a2bd01f6f6eb10
" />

???? ???????? ??? ??????: 

using System;

using

System.Web;

using

System.Web.UI;

namespace

MyProject

{

/// <summary>

/// ?????? ??? ??????????????? ???????? Unhandled exception

/// </summary>

public class ExceptionEventHandler : IHttpModule

{

public void Init(HttpApplication context)

{

context.Error +=

new EventHandler(context_Error);

}

void context_Error(object sender, EventArgs e)

{

Exception[] unhandledExceptions = HttpContext.Current.AllErrors;

foreach (Exception ex in unhandledExceptions)

{

// ?????????? ??????

}

HttpContext.Current.Server.ClearError();

HttpContext.Current.Response.Clear();

HttpContext.Current.Server.Transfer("/_layouts/myerrorpage.aspx");

}

public void Dispose()

{

}

}

}