我有一个 ASP.NET 4.0 Web 应用程序,用户可以在其中将视频上传到服务器。我有一个FileUpload
控件和 2DropDownList
秒。
FileUpload
用户首先从控件中选择要上传的视频,然后从DropDownList1
(类别列表)中选择类别。用户选择一个类别后,我用子类别填充第二个DropDownList
类别。
当我选择要上传的文件并从 中选择一个类别时DropDownList
,页面在回发后与服务器断开连接。如果我在不选择要上传的文件的情况下执行相同的场景,我会成功填充第二个组合。
这是我的代码:
<tr>
<td style="text-align: left;" class="style9" colspan="2">
<asp:Label ID="Label1" runat="server" Text="Video" Width="80px"></asp:Label>
<asp:FileUpload ID="FileUploadVideo" runat="server" ViewStateMode="Enabled" />
</td>
<td style="text-align: left;" class="style4">
<asp:Label ID="Label3" runat="server" Text="Category" Width="80px"></asp:Label>
<br />
<asp:DropDownList ID="cmbCategory" runat="server" AutoPostBack="True" OnSelectedIndexChanged="cmbCategory_SelectedIndexChanged">
</asp:DropDownList>
</td>
<td style="text-align: right;">
<asp:Label ID="Label6" runat="server" Text="Subcategory" Width="80px"></asp:Label>
<br />
<asp:DropDownList ID="cmbSubcategory" runat="server">
</asp:DropDownList>
</td>
</tr>
任何帮助,将不胜感激。