0

在 DNN 9.6 上,尝试运行自定义网络表单模块(最初基于 DNN 4.5 构建)我正在尝试上传文件

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

如果尝试第二次上传,它将工作并使用heade/request Content-Type: multipart/form-data; 边界=----WebKitFormBoundaryfzAkNd7yEs3BGnG8

如何在 DNN 中首次将其完全回发

<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>
4

1 回答 1

0

在您的清单中供您控制,您将拥有诸如。

<supportsPartialRendering>true</supportsPartialRendering>

将此值更改为“false”是确保不会通过异步帖子完成此操作的最可靠且最可靠的方法。有更高级的方法,但这是最简单的。

于 2020-08-05T01:31:08.947 回答