为什么& # 39;system.web.ui.scriptmanager& # 39;不包含'register

本文关键字:包含 register web system 为什么 ui scriptmanager | 更新日期: 2023-09-27 18:16:16

下载按钮不工作。我尝试这个方法:

  ImageButton lb = e.Row.FindControl("ImageButton1") as ImageButton;  
            if(lb != null)
            ScriptManager.RegisterPostbackControl(lb);
            int index = ((GridViewRow)((ImageButton)e.CommandArgument).Parent.Parent).RowIndex;

但为什么它说'system.web.ui. 'Scriptmanager '不包含'registerpostbackcontrol'的定义?我已经在header上使用了system.web.ui…请帮助

为什么& # 39;system.web.ui.scriptmanager& # 39;不包含'register

您必须将System.Web.Extensions.dll引用添加到您的项目中。

如果你已经这样做了,问题仍然存在,确保你的ScriptManager控件在你的页面没有ID ScriptManager,因为c#将尝试使用它来代替类