Hi, I want to display popup in page load and it should get disappear when i click outside that popup panel in asp.net. I have tried this javascript but its working like when i click button popup will display and when i click outside the panel popup will disappear. <style type="text/css"> body { font-family: Arial; font-size: 10pt; } .modalBackground { background-color: Black; filter: alpha(opacity=60); opacity: 0.6; } .modalPopup { background-color: #FFFFFF; width: 300px; border: 3px solid #0DA9D0; padding: 0; } .modalPopup .header { background-color: #2FBDF1; height: 30px; color: White; line-height: 30px; text-align: center; font-weight: bold; } .modalPopup .body { min-height: 50px; line-height: 30px; text-align: center; font-weight: bold; margin-bottom: 5px; } </style> <script type="text/javascript"> function pageLoad() { var modalPopup = $find('mpe'); modalPopup.add_shown(function () { modalPopup._backgroundElement.addEventListener("click", function () { modalPopup.hide(); }); }); }; </script> <body> <asp:Button ID="btnShow" runat="server" Text="Button" /> <asp:Panel ID="pnlPopup" runat="server" BackColor = "LightBlue" BorderColor= "Red" style="display:none" Width="466px" Height="400px"> <asp:Button ID="btn" runat="server" Text="Button" /> <cc1:ModalPopupExtender ID="ModalPopupExtender1" BehaviorID="mpe" runat="server" PopupControlID="pnlPopup" TargetControlID="btnShow" BackgroundCssClass="modalBackground"> </body> please help me thanks in advance
<script type="text/javascript"> pageLoad(); </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)