<asp:TextBox ID="TextBox1" runat="server" Height="30px" Width="700px" placeholder="Enter Title" ></asp:TextBox>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:AjaxFileUpload ID="AjaxUploadImages" runat="server" AllowedFileTypes="jpg,jpeg,png,gif"
onuploadcomplete="AjaxUploadImages_UploadComplete"/>
</ContentTemplate>
</asp:UpdatePanel>
我想在OnUploadComplete事件中获取TextBox1的文本,如下所示 -
protected void AjaxUploadImages_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
string path = Server.MapPath("~/images/") + e.FileName;
AjaxUploadImages.SaveAs(path);
string content = TextBox1.Text.ToString();
}
答案 0 :(得分:0)
protected void AjaxUploadImages_UploadComplete(object sender,AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
string path = Server.MapPath("~/images/") + e.FileName;
AjaxUploadImages.SaveAs(path);
string content = TextBox1.Text.ToString();
}