开发者

AsyncFileUpload within EditItemTemplate of ListView

I'm having trouble handling an AsyncFileUpload control within an EditItemTemplate in a ListView开发者_JAVA百科.

How do I reference the the AsyncFileUpload control when handling the OnUploadedComplete event in the code behind file?

I know that I can reference it within the OnItemUpdating event for the ListView but since it's an AsyncFileUpload how do I upload the file before saving the updates to the ListView item?

Thanks


You can reference it casting sender in the event handling code :

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜