触发链接按钮时,不会显示模型弹出窗口

时间:2015-08-04 05:07:00

标签: c# asp.net ajax

我有一个ModalPopupExtender,当我点击链接按钮时,我想显示弹出窗口。现在它不起作用。请告诉我在代码中应该做的更改。我的代码是,我的popup controle

  <cc1:ModalPopupExtender ID="ModalPopupExtender2" runat="server" 
   BehaviorID="modalPopupExtender2" 
   TargetControlID="hfHidden"
   PopupControlID="Div2" 
   OkControlID="cancel1" 
   BackgroundCssClass="modalPopup" >
  </cc1:ModalPopupExtender>  

我的链接按钮(它作为项目模板放在网格视图中)

  <asp:LinkButton ID="View" CausesValidation="false" runat="server" CommandArgument='<%#Eval("Employeeid")%>' OnClick="edit">Edit/View</asp:LinkButton>   

我的链接按钮单击事件处理程序,

 protected void edit(object sender, EventArgs e)
    {

        LinkButton btndetails = sender as LinkButton;
        GridViewRow gvrow1 = (GridViewRow)btndetails.NamingContainer;
        uname.Text= gvrow1.Cells[1].Text;
        ddrelationship2.SelectedItem.Text = gvrow1.Cells[2].Text;
        udob.Text = gvrow1.Cells[3].Text;
        this.ModalPopupExtender2.Show();
    }   

Div2包含一些文本框和所有内容。 用户界面是 enter image description here

1 个答案:

答案 0 :(得分:0)

尝试将以下内容放在web.config中:

<system.web>
 <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" smartNavigation="false">
相关问题