Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
ModalPopupExtender1.Show(); not working when clicking on image button on server side.

XML
<asp:Button ID="btnShowPopup" runat="server" Style="display: none" />
            <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnShowPopup"
                BehaviorID="ModalBehaviour" PopupControlID="pnlpopup" CancelControlID="btnCancel"
                BackgroundCssClass="modalBackground">
            </asp:ModalPopupExtender>
            <asp:Panel ID="pnlpopup" runat="server" BackColor="White" Height="269px" Width="400px"
                Style="display: none">


C#
protected void imgbtn_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton btndetails = sender as ImageButton;
        GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;
        lblID.Text = gvdetails.DataKeys[gvrow.RowIndex].Value.ToString();
        lblusername.Text = gvrow.Cells[1].Text;
        txtfname.Text = gvrow.Cells[2].Text;
        txtlname.Text = gvrow.Cells[3].Text;
        txtCity.Text = gvrow.Cells[4].Text;
        ModalPopupExtender1.Show();
    }
Posted
Updated 12-Nov-13 20:14pm
v3
Comments
Zoltán Zörgő 28-Mar-13 3:42am    
Please use "improve question" widget to add details to your original question!
And use the other widgets on the page as they should be used. I don't think that your extra information is a solution...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900