Sunday, March 11, 2012

Modalpopup Extender

Hi Archna,

You want to keep the Panel open when click on the submit Button which is inside the Panel, isn't it? If I have misunderstood, please feel free to let me know.

Based on this my solution is add an UpdatePanel to your page. When click on the submit Button, the UpdatePanel will be fired to send an asynchronous postback. Here is the sample.

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"></script><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server"> <title>Change Picture</title> <style> .modalBackground { background-color:Gray; filter:alpha(opacity=70); opacity:0.7; } .modalPopup { background-color:#FFD9D5; border-width:3px; border-style:solid; border-color:Gray; padding:3px; width:250px; } </style></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Height="200px" Width="300px" style="display:none"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate><%=DateTime.Now.ToString()%> <asp:Button ID="Button3" runat="server" Text="Submit" /> </ContentTemplate> </asp:UpdatePanel> <asp:Button ID="Button2" runat="server" Text="Cancel" /> </asp:Panel> <asp:Button ID="Button1" runat="server" Text="Button" /> <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button1" PopupControlID="Panel1" CancelControlID="Button2" BackgroundCssClass="modalBackground"> </ajaxToolkit:ModalPopupExtender> </div> </form></body></html>

I hope this help.

Best regards,

Jonathan


Thanks Jonathan.

You understood the question correctly and I have implemented the solution on the test application and it works fine..

Thankyou so much.

Archna

No comments:

Post a Comment