首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用<input type=‘DNN9’/>上传文件

使用<input type=‘DNN9’/>上传文件
EN

Stack Overflow用户
提问于 2020-08-04 22:49:41
回答 1查看 39关注 0票数 0

在DNN 9.6上,尝试运行自定义webform模块(最初在DNN 4.5上构建)我正在尝试上传文件

当第一次导航到页面时,上传结果总是在header/request body中包含postedfile = null,Content-Type: application/x-www-form-urlencoded;charset=UTF-8我可以在请求__ASYNCPOST: true中看到

如果尝试第二次上传,它将与标题/请求内容类型: multipart/form-data;boundary=----WebKitFormBoundaryfzAkNd7yEs3BGnG8一起工作

如何在DNN中第一时间实现完全回发

代码语言:javascript
复制
<table id="tblUpload" runat="server" cellspacing="0" cellpadding="0">
<tr><td valign="bottom">
<dnn:label id="plPhoto" runat="server" suffix=":" controlname="lnkPreview"></dnn:label>
</td>
<td valign="top">
    <input id="filePhoto" type="file" size="50" name="File1" runat="server"  />
</td>
</tr>
<tr>
<td valign="bottom"><dnn:label id="plSaveAsFile" runat="server" suffix=":" controlname="txtFileName"></dnn:label></td>
<td>
    <asp:textbox id="txtTitle" runat="server" Width="200px" MaxLength="200"></asp:textbox>
    &nbsp;&nbsp;
    <asp:linkbutton CssClass="CommandButton" id="cmdUpload" runat="server" borderstyle="none" text="Upload" resourcekey="cmdUpload"></asp:linkbutton>                   
    
    &nbsp;&nbsp;&nbsp;
    <asp:linkbutton class="CommandButton" id="cmdCancel2" runat="server" borderstyle="none" text="Cancel"
    resourcekey="cmdCancel" causesvalidation="False"></asp:linkbutton>
</td>
</tr>
</table>
EN

回答 1

Stack Overflow用户

发布于 2020-08-05 09:31:09

在你的控制清单中,你会有类似这样的东西。

代码语言:javascript
复制
<supportsPartialRendering>true</supportsPartialRendering>

将此值更改为"false“是最快也是最可靠的方法,可以确保这不是通过异步post完成的。有更高级的方法,但这是最简单的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63249423

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档