我在ASP中包装了类型为File的HTML输入控件:面板控件(包含在更新面板中)。 当我禁用ASP:面板控件时,仍然启用输入控件。请帮忙 ASPX代码:
<asp:Panel ID="pnlBrowseCSV" runat="server" Enabled="true">
<table>
<tr>
<td align="left" valign="top" style="height: 30px; width: 160px;">
<strong>CSV File:</strong>
</td>
<td style="height: 30px">
<input type="file" id="csvFile" runat="server"
onkeydown="return false" style="width: 350px; background-color:white"/>
<strong>(*.csv)</strong>
</td>
<td style="height: 30px">
<ASP:Button ID="btnValidate" Text="Validate" runat="server"
OnClick="btnValidate_Click" />
</td>
</tr>
</table>
</asp:Panel>
答案 0 :(得分:0)
使用可见属性而不是启用。
<asp:Panel ID="pnlBrowseCSV" runat="server" Visible="False">
答案 1 :(得分:0)
此问题为by design。您可以做的更多是编写一行代码来禁用文件上传,禁用面板。
pnlBrowseCSV.Enabled = false;
csvFile.Enabled=false;