locked
Display "Process Completed" Message in UpdateProgress. RRS feed

  • Question

  • User-1305858305 posted

    Hello

    I've Image button in my GridView and when user clickling this ImageButton opening Panel with AjaxModalPopUp Extender.

    In ModalPopUp I've UpdateProgress. 

    User clicking ok button then UpdateProgress starting display a gif. 

    I want to display "Completed" message at the end of OnClikEvent. 

    When I debugging, simply watching in debugger that Label control changing message but in the browser doesnt change anything.

    Any help?

    //aspx
     <tr style="height: 30px;">
                                                    <td>
                                                        <asp:UpdateProgress ID="updProgress" runat="server" DynamicLayout="true" AssociatedUpdatePanelID="UpdatePanelModalPopUpButtons">
                                                            <ProgressTemplate>                                                            
                                                                <div class="progress">
                                                                    <asp:Label runat="server" ID="LabelProgress" Text="Talep gönderiliyor." ></asp:Label>
                                                                </div>
                                                                <div class="progress">
                                                                      <asp:Image runat="server" alt="" style="vertical-align: middle;" src="/Images/ajax-loaderimg.gif"  /> 
                                                                </div>
                                                            </ProgressTemplate>
                                                        </asp:UpdateProgress>
                                                    </td>
                                                </tr>
                                                <tr align="center">
                                                    <td>
                                                        <asp:UpdatePanel runat="server" ID="UpdatePanelModalPopUpButtons">
                                                            <ContentTemplate>
                                                                <asp:Button ID="btnAddToCart"
                                                                    runat="server" Text="Evet"
                                                                    OnClick="ButtonSendStoneRequest_Click" Width="100px"
                                                                    OnClientClick="this.disabled=true;" UseSubmitBehavior="false" />
                                                                <asp:LinkButton ID="btnClose" runat="server" Text="Kapat" Width="100px" ForeColor="Navy" OnClientClick="return HideModalPopup()" /></td>                                            
                                                            </ContentTemplate>
                                                        </asp:UpdatePanel>
                                                </tr>
    //cs
     protected void ButtonSendStoneRequest_Click(object sender, EventArgs e)
        {        
            btnAddToCart.Enabled = false;
    //sending email
    //
    //
            btnAddToCart.Enabled = true;
    
            
            ((Label)updProgress.FindControl("LabelProgress")).Text = "Whatever you want it to say.";
            
            System.Threading.Thread.Sleep(5000);
           
          
            ModalPopupExtender1.Hide();        
            
            
        }

    Saturday, March 28, 2015 2:27 PM

Answers

  • User-824764785 posted

    Only ContentTemplate inside UpdatePanel updated in ajax.net, the label you placed inside updated progress will not changed until you put that label in another UpdatePanel

    <asp:updatepanel id=updCompleted runat=server>
        <contenttemplate>
          <div class="progress">
    <asp:Label runat="server" ID="LabelProgress" Text="Talep gönderiliyor." ></asp:Label> </div> </contenttemplate> </asp:updatepanel>
    <asp:UpdateProgress ID="updProgress" runat="server" DynamicLayout="true" AssociatedUpdatePanelID="UpdatePanelModalPopUpButtons"> <ProgressTemplate> <div class="progress"> <asp:Image runat="server" alt="" style="vertical-align: middle;" src="/Images/ajax-loaderimg.gif" /> </div> </ProgressTemplate> </asp:UpdateProgress>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 28, 2015 2:46 PM
  • User-824764785 posted

    I placed UpdatePanel outsite UpdateProgress because UpdateProgress goes invisible as soon as the request completes, you are using Thread.Sleep which is not going to help as is going to delay the response from server.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, March 29, 2015 4:32 AM

All replies

  • User-824764785 posted

    Only ContentTemplate inside UpdatePanel updated in ajax.net, the label you placed inside updated progress will not changed until you put that label in another UpdatePanel

    <asp:updatepanel id=updCompleted runat=server>
        <contenttemplate>
          <div class="progress">
    <asp:Label runat="server" ID="LabelProgress" Text="Talep gönderiliyor." ></asp:Label> </div> </contenttemplate> </asp:updatepanel>
    <asp:UpdateProgress ID="updProgress" runat="server" DynamicLayout="true" AssociatedUpdatePanelID="UpdatePanelModalPopUpButtons"> <ProgressTemplate> <div class="progress"> <asp:Image runat="server" alt="" style="vertical-align: middle;" src="/Images/ajax-loaderimg.gif" /> </div> </ProgressTemplate> </asp:UpdateProgress>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 28, 2015 2:46 PM
  • User-1305858305 posted

    Thank you for your reply

    But even I put UpdateProgress in UpdatePanel no luck.

    Only after second click displaying directly message which I define in OnClik event.  "Whatever you want it to say."

    Regards 

    Saturday, March 28, 2015 6:19 PM
  • User-824764785 posted

    I placed UpdatePanel outsite UpdateProgress because UpdateProgress goes invisible as soon as the request completes, you are using Thread.Sleep which is not going to help as is going to delay the response from server.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, March 29, 2015 4:32 AM