Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i click on Show dialog button the modelpop is not displayed..
but when i remove panel display style:none the modelpop is appeared.

how my pop is open plz help me..

XML
<%@ Page Language="C#" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="head" runat="server">
    <title>Delete Confirm Example</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form runat="server">
        <asp:ScriptManager runat="server" />
        <div>
            <p style="background-color:AliceBlue; width:95%;">
                Example of using a ModalPopupExtender with multiple delete buttons<br />
            </p>
            <br />

            <asp:Button ID="btnShow" runat="server" Text="Show Dialog" />

            <ajaxToolKit:ModalPopupExtender
                BehaviorID="mdlPopup" runat="server" TargetControlID="btnShow"
                PopupControlID="pnlPopup" OkControlID="btnYes" BackgroundCssClass="modalBackground" />

            <asp:Panel ID="pnlPopup" runat="server" CssClass="confirm-dialog" style="display:none;">
                <div>
                    <h2>Are you sure you want to delete this item?</h2>
                    <div>
                        <asp:Button ID="btnYes" runat="server" Text="Yes" />
                        <asp:Button ID="btnNo" runat="server" Text="No"
                            OnClientClick="$find('mdlPopup').hide(); return false;" />
                        <asp:LinkButton runat="server" CssClass="close"
                            OnClientClick="$find('mdlPopup').hide(); return false;" />
                    </div>
                </div>
            </asp:Panel>
        </div>
    </form>
</body>
</html>
Posted
Comments
Brij 7-Sep-10 3:27am    
I tried your code. it is working fine

1 solution

Hi Balongi,


Please use this code it is working fine.

This is modal popup button code (where you can open the popup)
XML
<asp:HyperLink runat="server" ID="hylSelectInstruction" NavigateUrl="javascript:void(0)"
                                                                   Text="Select Standard Instruction"></asp:HyperLink>


This is modal popup code
XML
<asp:ModalPopupExtender ID="ModalPopupExtender1" BehaviorID="bInstruction" runat="server"
                                            TargetControlID="hylSelectInstruction" PopupControlID="pnlInstruction" BackgroundCssClass="popupwrapper_transparentbg"
                                            DropShadow="false" PopupDragHandleControlID="pnlInstructionDragHandle" OkControlID="lbtnInstructionCancel"
                                            RepositionMode="RepositionOnWindowScroll" />
                                        <asp:Panel runat="server" ID="Panel1" Style="display: none; width: 600px;
                                            height: 300px;">
                                            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                                <tr>
                                                    <td >
                                                        <%--Yor modal popup form controls comes here.. --%>
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>



Thanks,
Imdadhusen
 
Share this answer
 
Comments
balongi 7-Sep-10 5:14am    
thanx....

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