如何清除 asyncfileupload 的文本框值..?
有一个按钮(MyButton)。 单击此按钮时,会出现一个 modalpopup(MyPopup),其中包含一个 asyncfileupload ajax 控件、“确定”按钮和“取消”按钮。
asyncfileupload 功能的浏览功能工作正常,没问题。 但是回发后,如果我再次单击 MyButton,弹出窗口将显示在 asyncfileupload 控件的文本框中,其中包含先前的路径。
怎么清除呢...!
提前致谢。
There is one button(MyButton).
OnClick of this button a modalpopup(MyPopup) appears with one asyncfileupload ajax control, Ok button and Cancel button.
The browse functionality of the asyncfileupload functionality is working fine, No problem.
But after postback, if I click the MyButton again, the popup appearing with the previous path in the asyncfileupload control's textbox.
How to clear it ... !
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
所提出的方法都不适合我。
问题并不特定于
AsyncFileUpload
,而是特定于input[type=file]。
最后,我找到了一种适用于 javascript 的方法:
None of the proposed ways worked for me.
The problem is not specific to
AsyncFileUpload
, but to theinput[type=file].
Finally, I found a way that worked for me with javascript:
将 AsyncFileUpload 描述符的属性设置为 OnClientUploadComplete="UploadComplete" 并使用下一个 JS:
您也可以将任何操作/样式应用于“fileInputElement”。
Set up attribute of AsyncFileUpload descriptor to OnClientUploadComplete="UploadComplete" and use next JS:
You can apply any actions/styles to the "fileInputElement" too.
如果您尝试在客户端清除它,这对我有用。
this worked for me if you're attempting to clear it client side.
扩展 ador 上面的答案:
To expand ador's answer above:
假设您使用 Ajax Control Toolkit 中的控件,您可以连接到 OnClientUploadedComplete 句柄,上传完成后客户端会调用该句柄。您想在模式弹出窗口上调用 hide
Assuming you're using the control from Ajax Control Toolkit you can hook into the OnClientUploadedComplete handle which is called on the client side once the upload is complete. You want to call hide on the modal popup
这是对 Jmoon 答案的更正。如果您想在上传完成后而不是在其他用户操作后清除 AsyncFileUpload 文本,这非常有用。
This is a correction for the Jmoon's answer. This is usefull if you want to clear AsyncFileUpload text not after upload complete but after some other user action.
这肯定会清除文本框:
This will definitely clear the textbox: