Asp:FileUpload 和 RAD ajaxmanager 不能一起工作
我有以下用于上传文件的代码:
<asp:Panel ID="pnlCauses" runat="server">
<asp:FileUpload ID="uplCauses" runat="server" />
<asp:Button runat="server" ID="btnUplCauses" Text="Upload" OnClick="btnUplCauses_Click" />
<asp:Label runat="server" ID="lblUplCausesStatus" Text="Upload status: " />
</asp:Panel>
并且我使用以下代码仅允许 pnlCauses 刷新。
<rad:AjaxSetting AjaxControlID="btnUplCauses">
<UpdatedControls>
<rad:AjaxUpdatedControl ControlID="pnlCauses" />
</UpdatedControls>
</rad:AjaxSetting>
但似乎上传控件和 Ajax 不能一起工作。
谁能建议我替代方案?那我怎样才能只允许面板刷新而不完成页面呢?
I have following code for uploading a file:
<asp:Panel ID="pnlCauses" runat="server">
<asp:FileUpload ID="uplCauses" runat="server" />
<asp:Button runat="server" ID="btnUplCauses" Text="Upload" OnClick="btnUplCauses_Click" />
<asp:Label runat="server" ID="lblUplCausesStatus" Text="Upload status: " />
</asp:Panel>
And i have used following code to allow only pnlCauses to refresh.
<rad:AjaxSetting AjaxControlID="btnUplCauses">
<UpdatedControls>
<rad:AjaxUpdatedControl ControlID="pnlCauses" />
</UpdatedControls>
</rad:AjaxSetting>
But seems Upload control and Ajax dont work together.
Can anyone suggest me alternatives ? That how can i allow only panel to refresh and not complete page ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ASP.NET FileUpload 无法使用 AJAX 调用上传文件。您必须强制回发请求,或使用类似 RadAsyncUpload 异步上传文件。
Telerik 文档为旧版 Telerik ASP.NET 控件提供了解决方法,介绍了如何禁用 RadAjaxPanel 中的上传按钮 AJAX 调用:
ASP.NET FileUpload cannot upload files using AJAX calls. You must force a postback request, or use a control like RadAsyncUpload to upload files asynchronously.
Telerik documentation has a workaround for older Telerik ASP.NET controls on how to disable upload button AJAX calls in a RadAjaxPanel: