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 4623438
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:59:14+00:00 2026-05-22T02:59:14+00:00

I have got a dropdown list populated with products from a product table. I

  • 0

I have got a dropdown list populated with products from a product table. I have a button named ADD Product, so when the user wants to add a new product instead of selecting product from the drop down list, one should click on add new then panel 1 should show which includes a textbox. Panel1 visibility is set to false by default and it should be visible when the user clicks on the button. Also I want a validation on dropdown list and textbox(if panel is visible). Below is the code which is not working :

   <asp:DropDownList ID="DropDownList1" runat="server">
         </asp:DropDownList>
         <%--<asp:TextBox ID="txtMake" runat="server" CssClass="txtStyle"></asp:TextBox>--%>
         <asp:Button ID="btnAdd" runat="server" />
         <asp:Panel ID="panel1" Visible="false" runat="server"><asp:TextBox ID="txtAddnew"></asp:TextBox></asp:Panel>
         <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Please Select a Product" ValidationGroup="insert" ControlToValidate="DropDownList1" ForeColor="Red"></asp:RequiredFieldValidator><br />

codebehind:

protected void btnAdd_Click(object sender, EventArgs e)
    {
        panel1.Visible = true;
    }
     protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            MultiView1.ActiveViewIndex = 0;
             DropDownList1.DataSource = caravans.GetProductNames();
            DropDownList1.DataBind();
        }
    }
  • 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-05-22T02:59:15+00:00Added an answer on May 22, 2026 at 2:59 am

    You can use this concept for validation on dropdownlist. I am given you an example please check this…

    <asp:DropDownList runat="server" ID="ddl">
                <asp:ListItem Value="-1" Text="Select"></asp:ListItem>
                <asp:ListItem Value="1" Text="One"></asp:ListItem>
                <asp:ListItem Value="2" Text="Two"></asp:ListItem>
            </asp:DropDownList>
            <asp:RegularExpressionValidator ID="reg1" runat="server" ControlToValidate="ddl"
                Display="Dynamic" ErrorMessage="Select Proper" SetFocusOnError="true" Text="Select Proper"
                ValidationGroup="check" ValidationExpression="^\d{0,5}$" />
            <asp:Button ID="btn" runat="server" ValidationGroup="check" Text="Submit" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The scenario is I have got 2 dropdown list and a table in which
I've got a nice drop down list working which is getting populated from a
I have got this controller: public class NewPostController : Controller { List<SelectListItem> languages= new
I've got an add product page for users to select a product from the
I have a page with a dropdown list defined as follows $memb=$this->api->db->dsql()->table('vscrum_member m') ->field('m.id')
I have got an ActiveX Control that gets an image from a fingerprint device
I have a dropdown list that I want to show only certain options when
I have got 2 drop down list in my php form. Values in the
I have got a main extending adapter which adds rows when user clicks on
I've got a user control thats used twice on the same page, each have

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.