我想使用AjaxFileUpload
控件上传文件。这很好用。问题是我无法在Label
上传的文件上显示成功/失败消息。
.aspx 代码..
<form id="form1" runat="server">
<div>
<div></div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Label runat="server" ID="myThrobber" Style="display: none;"><img align="absmiddle" alt="" src="images/uploading.gif"/></asp:Label>
<asp:AjaxFileUpload ID="AjaxFileUpload1"
runat="server"
OnUploadComplete="AjaxFileUpload1_UploadComplete"
OnClientUploadError="uploadError"
OnClientUploadComplete="uploadComplete"
ThrobberID="myThrobber"
MaximumNumberOfFiles="1"
AllowedFileTypes=""
class="name_text1"
Width="200px" />
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
<asp:Button ID="BtnClose" runat="server" Text="Close"
onclick="BtnClose_Click" OnClientClick="Closepopup()"/>
<asp:Label ID="Label2" runat="server" Text=""></asp:Label>
<br />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
我想在 Label2 上显示该文件是否上传的文本。我的 .cs 代码:
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
string message = "Storege Space is Exceeding its Limit";
Label2.Text = message;
}
如何在上面显示消息Label
?有什么建议吗?帮助表示赞赏