0

On DNN 9.6, try to run a custom webform module (built originally on DNN 4.5) I am trying to upload file

When first navigating to the page, the upload result is always with the postedfile = null In header/request body, the Content-Type: application/x-www-form-urlencoded; charset=UTF-8 I can see in the request __ASYNCPOST: true

If try to upload the second time, it will work and with heade/request Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryfzAkNd7yEs3BGnG8

How to get it to full postback at the first time in 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>

1 Answers1

0

Inside of your manifest for your control, you will have something such as.

<supportsPartialRendering>true</supportsPartialRendering>

Changing this value to "false" is the fasted, and most reliable method to ensure that this is not done via an Async post. There are more advanced ways of doing it, but this is the easiest.

Mitchel Sellers
  • 62,228
  • 14
  • 110
  • 173