Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,

Here my prob is i did't call modelpopup extender id not showing in code behind page

my code is

XML
<asp:TemplateField HeaderText="">
                                       <ItemTemplate>
                                           <asp:ImageButton ID="ImageButton3" class="closeImage" runat="server"
                                               Width="25px" Height="20px" ImageUrl="Images/serialnumber.png"
                                               ToolTip="Add SerialNumber" onclick="ImageButton3_Click" />
                                           <asp:HiddenField ID="HiddenField1" runat="server" />
                                               <asp:ModalPopupExtender ID="modelpopupserial" runat="server" BackgroundCssClass="modalBackground" TargetControlID="HiddenField1" PopupControlID="paneltxtpopup" CancelControlID="imgclose"></asp:ModalPopupExtender>
                                       </ItemTemplate>
                                   </asp:TemplateField>
Posted
Comments
hypermellow 22-Jul-14 8:53am    
Hi, where in your code behind are you attempting to reference the modalpopup control?

It is because you are taking the ModalPopupExtender inside Gridview and hence you are unable to access it.
What you can do is take the ModalPopupExtender outside the gridview. Following code might help.

In the aspx page:

XML
<cc1:ModalPopupExtender BackgroundCssClass="modalBackground" ID="ModalPopupExtender1" PopupControlID="pnlEdit" TargetControlID="default" runat="server"></cc1:ModalPopupExtender>
         <asp:Button ID="default" runat="server" style="display:none"/>
        <asp:Panel ID="pnlEdit" runat="server" CssClass="modalpopup" Direction="LeftToRight" style="display:none"> Your Code here


And on the Click event of Image button :-

protected void ImageButton3_Click(object sender, EventArgs e)
        {
            ModalPopupExtender1.Show();
        }



Hope This helps you :)
 
Share this answer
 
Hello frnd..you can also use FindControl method of Gridview to find ur ModelPopup...but generally we give modelpopup outside the grid view control...

Thanks
 
Share this answer
 

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