AsyncFileUpload within EditItemTemplate of ListView

本文关键字:ListView of EditItemTemplate within AsyncFileUpload | 更新日期: 2023-09-27 18:01:15

我在处理ListViewEditItemTemplate内的AsyncFileUpload控件时遇到问题。

在处理代码隐藏文件中的OnUploadedComplete事件时,如何引用AsyncFileUpload控件?

我知道我可以在ListViewOnItemUpdating事件中引用它,但由于它是AsyncFileUpload,在将更新保存到ListView项目之前,我如何上传文件?

感谢

AsyncFileUpload within EditItemTemplate of ListView

您可以在事件处理代码中引用它铸造发送方

protected void AttachmentAsyncFileUpload_Complete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
{
    var FileUploader = sender as AjaxToolkit.AsyncFileUpload;
    FileUploader.SaveAs("testuploadedfile.tmp");
}