0
我写了HTTPModule
对重定向目的并安装在GAC和根web.config
文件引用。它非常适合团队网站。SharePoint发布网站的HttpModule
我使用PreRequestHandlerExecute
看到请求页面或不并呼吁
public void Init(HttpApplication context)
{
this.app = context;
this.app.PreRequestHandlerExecute += new EventHandler(Application_PreRequestHandlerExecute);
}
void Application_PreRequestHandlerExecute(object source, EventArgs e)
{
Page page = HttpContext.Current.CurrentHandler as Page;
if (page != null)
{
page.PreInit += new EventHandler(Perform_Redirection);
}
}
,并在Perform_Redirection
方法,我做重定向的东西。
void Perform_Redirection(object source, EventArgs e)
{
//logic goes here for redirection
}
上述代码适用于Teamsites,但不适用于发布网站。该Page.PreInit
不点火的发布网站。
请帮我解决这个问题!
我正在使用PreRequestHandlerExecut
e,因为我需要会话对象和其他详细信息,否则我会使用BeginRequest
。
如果所描述它解决了这个问题你应该接受这个答案解决它。 – razlebe 2011-09-14 14:58:36