开发者

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

开发者 https://www.devze.com 2022-12-24 05:00 出处:网络
I开发者_运维知识库 reference the current page in a class with Page page = HttpContext.Current.CurrentHandler as Page;

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

精彩评论

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