使用HttpModule控制SharePoint页面跳转

来源:互联网 发布:少女时代关系分析知乎 编辑:程序博客网 时间:2024/06/07 04:07

使用HttpModule控制SharePoint页面跳转,代码后续会贴上

 

 

public class SwithPages
{
 public void Dispose()
 {

 }

    Public void Init(HttpAppliation context)
    {
        if(context!=null)
        {
            context.PreRequestHandlerExcute+=new EventHandler(context_PreRequestHandlerExcute);
        }
    }

    void context_PreRequestHandlerExcute(object sender,EventArgs e)
    {
        //以下这句话代码要注意,在sharepoint页面中,跳转到目的页面后,如果使用其他方式
        //获取页面,而不是以下方式,那么用F5刷新页面,会出现加载失败sharepoint内置的一些js
        Page page=HttpContext.Current.CurrentHandler as Page;
        if(page!=null)
        {
            page.PreInit+=new EventHandler(page_PreInit);
        }
        else
        {
        }
    }


    void page_PreInit(object sender,EventArgs e)
    {
        //add to do
    }

 

}

 

原创粉丝点击