【发布时间】:2019-07-26 16:23:11
【问题描述】:
我有一个流程,一旦您单击按钮,您将获得有关您在流程中所处位置的更新。 (处理 11 个中的 1 个)
我曾尝试使用文本框和标签将文本保存在 UpdatePanel 中,但随着流程的进行,我似乎无法获得更新。
它没有更新。这是我的代码。
<div class="w3-row-padding w3-center w3-mobile">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="cmdSubmit" runat="server" Text="Create Life Budget" CssClass="w3-button w3-black" Font-Bold="False" UseSubmitBehavior="False" />
<br />
<br />
<asp:TextBox ID="txtProgress" runat="server" BackColor="Transparent" BorderStyle="None" Width="300px">In Progress ...</asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</div>
Protected Sub cmdSubmit_Click(sender As Object, e As EventArgs) Handles cmdSubmit.Click
divBudgetList.Visible = False
divCreateBudget.Visible = True
divReports.Visible = True
Master.HideMsg()
CreateLifeBudget()
End Sub
Public Sub CreateLifeBudget()
Dim iProgress As Long
Dim iProgressMax As Long = 11
iProgress = 1
txtProgress.Text = "Processing " & iProgress & " of " & iProgressMax
.... Other Code
iProgress = 1
txtProgress.Text = "Processing " & iProgress & " of " & iProgressMax
.... Other Code
txtProgress.Text = "Processing has completed"
End Sub
我已尝试将 updatemode 设置为条件和 Always。 我也添加了触发器。
似乎没有任何效果。
任何帮助将不胜感激。
【问题讨论】:
-
因为您在设置 .Text 之前直接设置了 `iProgress = 1,所以您将始终显示 1 of 11。
标签: asp.net vb.net updatepanel