简体   繁体   中英

Model pop up does not show when link button is triggered

I have a ModalPopupExtender, when I click on link button I want to show the pop up. Now it is not working. Please let me know the changes I should do in my code. My code is, MY popup controle

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

My link button(it placed inside a grid view as an item template)

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

My link button click event handler,

 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 contains some text box and all . UI is 在此处输入图片说明

Try to put the following in your web.config:

<system.web>
 <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" smartNavigation="false">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM