Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Control multiple UpdateProgress with one external button?

$
0
0

I'm using Visual Studio 2015 with SQL Server 2014, VB.  Sorry if this question is in the wrong section but I'm not sure where it really belongs.

I have the test code below which has three UpdateProgress sections each with their own separate control button.  The question is: Can one external button control all three UpdateProgress sections; one running right after the other with each displaying their own progress?

<%@ Page Language="VB" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        ' Introducing delay for demonstration.
        System.Threading.Thread.Sleep(3000)
        Label1.Text = "Capacitors exported at " & DateTime.Now.ToString()
    End Sub

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        ' Introducing delay for demonstration.
        System.Threading.Thread.Sleep(3000)
        Label2.Text = "Connectors exported at " & DateTime.Now.ToString()
    End Sub

    Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        ' Introducing delay for demonstration.
        System.Threading.Thread.Sleep(3000)
        Label3.Text = "Crystals & Oscillators exported at " & DateTime.Now.ToString()
    End Sub</script><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server"><title>UpdateProgress Tutorial</title><style type="text/css">
    #UpdatePanel1, #UpdatePanel2, #UpdatePanel3 {
      width:500px; height:100px;
     }</style></head><body><form id="form1" runat="server"><div><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><fieldset><asp:Label ID="Label1" runat="server" Text="Capacitors"></asp:Label><br /><asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /><asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"><ProgressTemplate><script type="text/javascript">
                                document.write("<div class='UpdateProgressBackground'></div>");</script><center><div class="UpdateProgressContent"
                                    style="border-width: 1px; border-style: double; background-color: #FFFFFF; font-weight: bold; left: 572px; height: 29px;">
                                Capacitor export in process...<asp:Image id="CapWaitCap" runat="server" ImageUrl="~/Images/progress.gif"/></div></center></ProgressTemplate></asp:UpdateProgress></fieldset></ContentTemplate></asp:UpdatePanel><asp:UpdatePanel ID="UpdatePanel2" runat="server"><ContentTemplate><fieldset><asp:Label ID="Label2" runat="server" Text="Connectors"></asp:Label><br /><asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button2_Click" /><asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel2"><ProgressTemplate><script type="text/javascript">
                                document.write("<div class='UpdateProgressBackground'></div>");</script><center><div class="UpdateProgressContent"
                                    style="border-width: 1px; border-style: double; background-color: #FFFFFF; font-weight: bold; left: 572px; height: 29px;">
                                Connector export in process...<asp:Image id="CapWaitCon" runat="server" ImageUrl="~/Images/progress.gif"/></div></center></ProgressTemplate></asp:UpdateProgress></fieldset></ContentTemplate></asp:UpdatePanel><asp:UpdatePanel ID="UpdatePanel3" runat="server"><ContentTemplate><fieldset><asp:Label ID="Label3" runat="server" Text="Crystals & Oscillators"></asp:Label><br /><asp:Button ID="Button3" runat="server" Text="Button" OnClick="Button3_Click" /><asp:UpdateProgress ID="UpdateProgress3" runat="server" AssociatedUpdatePanelID="UpdatePanel3"><ProgressTemplate><script type="text/javascript">
                                document.write("<div class='UpdateProgressBackground'></div>");</script><center><div class="UpdateProgressContent"
                                    style="border-width: 1px; border-style: double; background-color: #FFFFFF; font-weight: bold; left: 572px; height: 29px;">
                                Crystals & Oscillators export in process...<asp:Image id="CapWaitCry" runat="server" ImageUrl="~/Images/progress.gif"/></div></center></ProgressTemplate></asp:UpdateProgress></fieldset></ContentTemplate></asp:UpdatePanel></div></form></body></html>

VB code behind:

Partial Class TestCprog
    Inherits System.Web.UI.Page
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        ' Introducing delay for demonstration.
        System.Threading.Thread.Sleep(3000)
        Label1.Text = "Capacitors complete at " & DateTime.Now.ToString()
    End Sub

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        ' Introducing delay for demonstration.
        System.Threading.Thread.Sleep(3000)
        Label2.Text = "Connectors complete at " & DateTime.Now.ToString()
    End Sub
    Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        ' Introducing delay for demonstration.
        System.Threading.Thread.Sleep(3000)
        Label3.Text = "Crystals & Oscillators complete at " & DateTime.Now.ToString()
    End Sub

End Class

Thanks is advance!


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>