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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:51:42+00:00 2026-05-23T19:51:42+00:00

I have an asp.net dropDownList which is automatically bound to a sqlDataSource to values

  • 0

I have an asp.net dropDownList which is automatically bound to a sqlDataSource to values of client type on page load. On page load I am also creating a Client object, one of it’s properties is ClientType. I am trying to set the SelectedValue of the ddl according to the value of the ClientType property of the Client object unsuccessfully. I recieve the following error message “System.ArgumentOutOfRangeException: ‘ddlClientType’ has a SelectedValue which is invalid because it does not exist in the list of items”. I understand that this is because the list has not yet been populated when I’m trying to set the selected value. Is there a way of overcoming this problem? Thank you!

  • 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-23T19:51:43+00:00Added an answer on May 23, 2026 at 7:51 pm

    You have to use the DataBound Event, it will be fired, once databinding is complete

    protected void DropDownList1_DataBound(object sender, EventArgs e)
    {
        // You need to set the Selected value here...
    }
    

    If you really want to see the value in the Page load event, then call the DataBind() method before setting the value…

    protected void Page_Load(object sender, EventArgs e)
    {
        DropdownList1.DataBind();
        DropdownList1.SelectedValue = "Value";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two dropdownlist which shows places in my asp.net MVC(C#) application. The First
I have the following JavaScript to toggle a dropdownlists in a ASP.NET page, which
I have an ASP.NET webform on which I use a DropDownList control to allow
I have an ASP.Net web page, which uses a Master Page template. The page
I have the javascript code below which disables an asp.net button during page postback.
What's the best method for handling a situation where you have an ASP.Net Dropdownlist
Is there anyway to have items in an ASP.NET DropDownList have either their Text
I have an ASP.NET GridView with a DropDownList (in an Item Template) and a
I have a asp.net 2.0 web site with numerous asp:DropDownList controls. The DropDownList control
I have ASP.NET web pages for which I want to build automated tests (using

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.