November 14th, 2007, 05:06 AM
I've been using the above control for some time with no problem with it working on a button click event.
However, this time the scenario is slightly different and I need to force the modalpopup to show during the button click event.
When the user presses my button on a form, I show a messagebox. Depending on the answer, I then either drop out of the click event or I continue. If I continue i want my popup to show since this is basically a progress bar.
in the aspx page I have :
and further down at the end of the UpdatePanel i have
<asp:Content ID="Content1" ContentPlaceHolderID="content" Runat="Server">
<cc1:ModalPopupExtender ID="PopUpdate" runat="server" PopupControlID="UpdateProgress1" TargetControlID="btnFake" BackgroundCssClass="modalBackground"></cc1:ModalPopupExtender>
$get('<%=UpdateProgress1.ClientID %>').className = "modalpopup";
If I place cmdSave inside the updatepanel, my popup shows as soon as the button is clicked and I do not get my messagebox first. so I've placed it outside the updatepanel.
<div style="margin-left:95%;"><asp:Button ID="cmdSave" runat="server" Text="Save"/></div>
<ajax:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="AjaxUpdate" DynamicLayout="true" DisplayAfter="0">
<asp:Panel ID="UpdateProgressPanel" runat="server" Height="154px" Width="154px" BackColor="White" BorderStyle="Solid" HorizontalAlign="center">
<center><asp:Image ImageUrl="~/App_Themes/Standard/images/BigAjaxWait.gif" runat="server" ID="imgProgress1" />
<p /><b>Refreshing, please wait...</b></center>
In Code assuming the user said yes to the messagebox, I have
but because it's still in the event and no postback has happened the popup does not show and instead my code continues on through.
If you find my answers helpful, dont forget to rate me
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!