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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:42:34+00:00 2026-05-24T15:42:34+00:00

I got a weird problem. I use a DropDownList item in a web application.

  • 0

I got a weird problem. I use a DropDownList item in a web application. after i check for the first time one of the options all the items are added to end of the list.
initialized like this

 protected void Page_Load(object sender, EventArgs e)
    {
        string myXMLfile = Server.MapPath("~/VMlist.xml");
        DataSet dsMachines = new DataSet();
        try
        {
            dsMachines.ReadXml(myXMLfile);
            DropDownList1.DataSource = dsMachines;
            DropDownList1.DataValueField = "machineID";
            DropDownList1.DataTextField = "machineName";
            DropDownList1.DataBind();

        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }

and the SelectedIndexChanged:

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {

        machineOS.Text = OSdata.OSDataRetrieve.getOSInfo(DropDownList1.SelectedItem.Text);

    }

i use XML initializing. I’m also adding an image of ‘before’ and ‘after’image

  • 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-24T15:42:35+00:00Added an answer on May 24, 2026 at 3:42 pm

    You need to add the following to your Page_Load:

    if (!Page.IsPostBack)
    {
        //code to bind dropdown
    }
    

    Your list is being bound each time the page posts back, which is why you’re getting duplicates. Add the above line, and you should be all set.

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

Sidebar

Related Questions

I really got a weird problem where a user register symfony save 2 time
I'm trying to embed groovy in java application and got a weird problem. Let's
I got very weird issue with managedObjectContext:save. It hasn't happened at the first time
Weird problem this. I've got a web page that fades images in and out
I've got this weird problem - I'm calling ChangeServiceConfig on a newly installed service
I've got a really weird problem and i'm wondering if it's a visual's bug
i got a weird problem regarding egrep and pipe I tried to filter a
I got a weird problem. I have a program that (does many things but
I've got a weird one when I test on the iPhone... I have a
Got a weird problem with my NSMutableArray and UITableView. It's got 4 items in

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.