问题1:modalpopup弹出的panel中的控件不返回服务器
解决方案:将modalpopupextender中的okcontrolid属性去掉
问题2:如何在gridview中的link链接弹出对话框
解决方法:加入一个button控件,
<asp:Button ID="Button2" runat="server" Text="无实际作用,仅用作PopupControlID" Style="display: none" />
targetcontrolid=“控件名”不要写link控件名,targetcontrolid=“button2”
后台代码:
gridview中link事件:
protected void link_Click(object sender, EventArgs e)
{
ModalPopupExtender1.Show();
}