【发布时间】:2016-02-07 04:56:01
【问题描述】:
我有这个,但它不起作用...我错过了什么吗?
例如,我需要在单击按钮时使用 UpdateProgess 更改文本。
这是我的ascx:
<asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="upFormulario">
<ProgressTemplate>
<div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0; right: 0; left: 0; z-index: 9999999; background-color: #000000; opacity: 0.7;">
<%--<span id="lblInfo" style="border-width: 0px; position: fixed; padding: 50px; background-color: #FFFFFF; font-size: 36px; left: 40%; top: 40%;">Loading...</span>--%>
<asp:Label id="lblInfo" Text="..." runat="server" style="border-width: 0px; position: fixed; padding: 50px; background-color: #FFFFFF; font-size: 36px; left: 40%; top: 40%;" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="upFormulario" runat="server">
...
<table width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="100%" align="right" nowrap="nowrap">
<asp:Button runat="server" Text="Next" ID="btnSave" OnClick="cmdSaveDraft_Click" class="ms-ButtonHeightWidth" />
</td>
</tr>
</tbody>
</table>
...
</asp:UpdatePanel>
这是我在ascx.cs上的代码
protected void cmdSaveDraft_Click(object sender, EventArgs e)
{
Label progressMessageLabel = this.UpdateProgress2.FindControl("lblInfo") as Label;
if (progressMessageLabel != null)
{
progressMessageLabel.Text = "Saving...";
}
lblAccion = "Loading...";
int iControl = this.ValidateCtrl();
if (iControl == 1)
{
return;
}
}
谢谢!
【问题讨论】:
-
您遇到的错误是什么? cmdSaveDraft_Click 在您的视图中引用的位置在哪里?我认为您的问题需要更多细节。
-
没有错误,我需要在单击按钮时更改 lblInfo 标签内的文本。很明显,更新面板中引用了 cmdSaveDraft_Click。
-
你说“很明显”,但我看不到代码...
-
我没有写 ir 因为我觉得没必要
-
你可以使用javascript
标签: c# asp.net sharepoint