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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:52:38+00:00 2026-06-10T16:52:38+00:00

I am new at C#/.net programming and am creating a example website.I need the

  • 0

I am new at C#/.net programming and am creating a example website.I need the code for displaying a hidden textbox/listbox by selecting the item from another listbox.I’ve tried the code which is not correct,

        protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        ListBox1.Items.Add("Sales");
        ListBox1.Items.Add("Inventory");
        ListBox1.Items.Add("Employee");
        ListBox1.Items.Add("Cash Drop");
        TextBox1.Visible = false;
        if (ListBox1.SelectedItem.value == "Sales" )
        {
            TextBox1.Visible = true;  
        }    

     }

can anybody help me please!!!!!

  • 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-10T16:52:40+00:00Added an answer on June 10, 2026 at 4:52 pm
     protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TextBox1.Visible = false;
                ListBox1.Items.Clear();
                ListBox1.Items.Add("Sales");
                ListBox1.Items.Add("Inventory");
                ListBox1.Items.Add("Employee");
                ListBox1.Items.Add("Cash Drop");
            }
        }
        protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ListBox1.SelectedItem.Text == "Sales")
            {
                TextBox1.Visible = true; 
            }    
        }
    

    And dont forget to turn AutoPostBack="true" in your Listbox :

    <asp:ListBox ID="ListBox1" AutoPostBack="true"></asp:ListBox>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello I'm new to PHP programming and I migrated from ASP .net to PHP..
Im new to .net c# programming and i need to read remote xml file
I'm an ASP.NET newbie, but not so new at programming in general. I'm creating
I am new to .NET programming. We are a team of 4 members developing
I'm new to VB.NET programming. What I'm confused about is the different ways one
I am completely new to ASP.NET programming, and was asked to work on a
I'll admit, I am pretty new with ASP .NET programming and I have been
I'm pretty new to asp net 2.0 programming and I was wondering how can
I'm fairly new to VB.NET, and I've mainly been doing ASP programming up 'til
I'm new to Android & Java programming but have been programming in .NET for

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.