开发者

How to reference a scriptmanager from HttpContext.Current.CurrentHandler?

I开发者_运维知识库 reference the current page in a class with

Page page = HttpContext.Current.CurrentHandler as Page;

I know need to reference ScriptManager1. What the syntax ?

Thanks.


Or

Page page = HttpContext.Current.CurrentHandler as Page;

if (page != null)
{
    ScriptManager smgr = ScriptManager.GetCurrent(page);
}


ScriptManager sm = (ScriptManager)page.FindControl("ScriptManager1");

if(sm != null)
{
    // Control found

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜