我正在使用工具箱控件(例如文本框、下拉列表)验证用户输入,我希望当用户在下拉列表中选择一个选项时,使其显示或隐藏其下方的上传控件。
例如,在下面的代码中被选为孤独工作作为是答案时,我希望孤独的工作过程文档的文件上传控制要显示在下面的显示,但如果它是一个否答案,我不希望将文件上传到控制展示。
任何帮助将不胜感激。谢谢
<td class="question">
Lone Working:
</td>
<td>
<asp:DropDownList ID="DDLONE" runat="server" Width="150px"
OnSelectedIndexChanged="DDLONE_SelectedIndexChanged">
<asp:ListItem Text="Yes"></asp:ListItem>
<asp:ListItem Text="No"></asp:ListItem>
</asp:DropDownList>
<span class="mandatory">*</span>
<asp:RequiredFieldValidator ID="RequiredFieldValidator27" runat="server" ControlToValidate="DDLONE" ErrorMessage=" Required." InitialValue="Please select one..." ForeColor="Red" SetFocusOnError="true"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="question">
Lone Working Company Procedure:
</td>
<td>
<asp:AsyncFileUpload ID="AsyncFileUpload3" runat="server" UploaderStyle="Traditional"
PersistedStoreType="Session" CssClass="answer" style="float:left" PersistFile="True" CompleteBackColor="#C3D021" />
<div class="mandatory" style="display:inline">*</div>
<%--- <asp:RequiredFieldValidator ID="AsyncFileUpload3_RequiredFieldValidator" runat="server"
ErrorMessage=" Required."
ForeColor="Red"
ControlToValidate="AsyncFileUpload3"></asp:RequiredFieldValidator>
<asp:TextBox ID="txtUplLone" runat="server" style="display:none" MaxLength="0" /> ---%>