为什么'system.web.ui.scriptmanager'不包含"寄存器回传控制"的定义?



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

  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…请帮助

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

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

最新更新