在 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>
<asp:linkbutton CssClass="CommandButton" id="cmdUpload" runat="server" borderstyle="none" text="Upload" resourcekey="cmdUpload"></asp:linkbutton>
<asp:linkbutton class="CommandButton" id="cmdCancel2" runat="server" borderstyle="none" text="Cancel"
resourcekey="cmdCancel" causesvalidation="False"></asp:linkbutton>
</td>
</tr>
</table>