Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8455521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:18:25+00:00 2026-06-10T12:18:25+00:00

I am validating user input using toolbox controls eg text boxes, drop down lists,

  • 0

I am validating user input using toolbox controls eg text boxes, drop down lists, I want to when a user selects a option in a drop down list make it either show or hide a Upload control below it.

For example in the code below when lone working is selected as YES Answer, I wish for the file upload control for a Lone working procedure document to be displayed below, but if it was a NO answer I wouldn’t want the File upload control to display.

Any help would be much appreciated.Thanks

  <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" /> ---%>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:18:27+00:00Added an answer on June 10, 2026 at 12:18 pm

    You can try with this code

    1 Add AutopostBack="true"
    <asp:DropDownList ID="DDLONE" runat="server" Width="150px" 
                                OnSelectedIndexChanged="DDLONE_SelectedIndexChanged" AutopostBack="true">
    
    
    2
    
     protected void DDLONE_SelectedIndexChanged(object sender, EventArgs e)
     {
        if(DDLONE.SelectedItem.Text == "Yes")//Adjust
        {
           AsyncFileUpload3.Visible = true;
        }
        else
        {
           AsyncFileUpload3.Visible = false;
        }    
     }
    

    Nota : You must bind your dropdownlist with this method (just one time)

    if(! IsPostBack)
    {
      //Bind
    }
    

    And use ViewState to persist your DropDownList

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering what the prefered method of validating user input in asp.net using
I recently found out that a method I've been using for validating user input
I'm validating some input ( type=text ) boxes with JavaScript (jQuery). They are on
i am validating user input in my application using Struts2 build in validation framework
I want to do input validation with jQuery. Every time the user blurs an
My problem concerns validating/normalising a user's input for the combination of Country and 'City'
What's the best way of validating an HTML text input as it's typed? All
I am using XML serialization to read a large user input file. If there
I am having trouble validating user input, I have the following loop which definitely
Using jQuery validation - validating on blur: $('input, select, radio, checkbox').blur(function(){ $(#createAccount).validate().element(this); }); If

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.