如何引用从HttpContext.Current.CurrentHandler一个ScriptManager? [英] How to reference a scriptmanager from HttpContext.Current.CurrentHandler?

查看:99
本文介绍了如何引用从HttpContext.Current.CurrentHandler一个ScriptManager?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我引用当前页面的带班

 页页= HttpContext.Current.CurrentHandler的页面;

我知道需要引用ScriptManager1。什么语法?

感谢。


解决方案

  ScriptManager的SM =(ScriptManager的)page.FindControl(ScriptManager1);如果(SM!= NULL)
{
    //控制发现}

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.

解决方案

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

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

}

这篇关于如何引用从HttpContext.Current.CurrentHandler一个ScriptManager?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆