从 C# 代码后面创建的多个 AJAX asyncfileupload
我有多个从 C# 背后的代码创建的 asyncfileupload 控件,但我无法弄清楚如何从代码的 UploadedComplete 部分或任何与此相关的实例引用正确的控件实例。
我在一个页面中使用 20 个异步文件上传,所有这些都在不同的模式弹出控件中,因此当您单击按钮时,从每次触发后的代码创建所有控件。因此仅使用 C# 是绝对必要的。
每个实例的创建方式如下:
AsyncFileUpload afuUploadEvents = new AsyncFileUpload();
afuUploadEvents.ID = "AsyncFileUploadId";
afuUploadEvents.UploadedComplete += new EventHandler<AsyncFileUploadEventArgs>this.afuUpload_UploadedComplete);
// other settings... blah blah blah...
这是查找控件的尝试:
protected void afuUpload_UploadedComplete(object sender, AsyncFileUploadEventArgs e)
{
// get the file upload control - doesn't work
AsyncFileUpload oFileUpload = (AsyncFileUpload)sender;
// Try again - doesn't work
ContainerElem.FindControl("AsyncFileUploadId");
}
如何获取上传处理程序中发生的特定实例?
~E
I have multiple asyncfileupload controls created from code behind C# and I can't figure out how to reference the right control instance from the UploadedComplete section of my code, or any instance for that matter.
I'm using 20 async file uploads in one page all in different modal popup controls so creating all my controls from code behind each fire when you click a button. So using only c# is absolutely necessary.
Each instance is created as follows:
AsyncFileUpload afuUploadEvents = new AsyncFileUpload();
afuUploadEvents.ID = "AsyncFileUploadId";
afuUploadEvents.UploadedComplete += new EventHandler<AsyncFileUploadEventArgs>this.afuUpload_UploadedComplete);
// other settings... blah blah blah...
Here is the attempts to find the control :
protected void afuUpload_UploadedComplete(object sender, AsyncFileUploadEventArgs e)
{
// get the file upload control - doesn't work
AsyncFileUpload oFileUpload = (AsyncFileUpload)sender;
// Try again - doesn't work
ContainerElem.FindControl("AsyncFileUploadId");
}
How can I get the specific instance that is occurring in my upload handler?
~E
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)