您的位置:首页 > 理论基础 > 计算机网络

使用HttpModule控制SharePoint页面跳转

2012-07-18 21:28 363 查看
使用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

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: