2010-11-24 88 views
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

回答

0

我通過移動重定向代碼到的PreRequestHandlerExecute事件處理

+1

如果所描述它解決了這個問題你應該接受這個答案解決它。 – razlebe 2011-09-14 14:58:36