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

  • Home
  • SEARCH
  • 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 847055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:43:07+00:00 2026-05-15T06:43:07+00:00

This is probably something really stupidly simple.. I have a drop down list bound

  • 0

This is probably something really stupidly simple..

I have a drop down list bound to an object data source. I have set AppendDataBoundItems to true so that I can have an initial select.

<asp:DropDownList ID="Accommodations1" runat="server" AutoPostBack="true" DataTextField="AccommodationTypeDescription" DataValueField="Id" OnDataBound="Accommodations1_DataBound" onSelectedIndexChanged="Accommodations1_SelectedIndexChanged" Width="200px" DataSourceID="AccommodationDs" AppendDataBoundItems="true">
       <asp:ListItem Text="Select" Value=""></asp:ListItem>
</asp:DropDownList>

<asp:ObjectDataSource ID="AccommodationDs" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="ListByPropertyId" TypeName="PropertyAccommodationController">
      <SelectParameters>
           <asp:Parameter Name="PropertyId" Type="Int32" />
      </SelectParameters>
</asp:ObjectDataSource>

I have a button which adds an accommodaton – so after that happens I need the dropdown list to update to include the new accommodation. So I’ve tried calling databind on the dropdownlist, and databind on the datasource – and nothing is making this dropdown list update.

eg. PropertyAccommodations1.DataBind();

Could someone please let me know what I’m doing wrong. Originally I thought it was due to an update panel issue.. but I’ve removed the update panel and it still doesn’t work (and checked the master page doesn’t include an update panel).

Thanks!!

  • 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-15T06:43:08+00:00Added an answer on May 15, 2026 at 6:43 am

    Thanks for the quick responses – have implemented

    Accommodations1.Items.Insert(0,new ListItem("Select","")); 
    

    as I specifically wanted it at the top 🙂

    I still think it would be neater to have this default item in the source of the page – but that AppendDataItems is tripping me up.

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

Sidebar

Related Questions

I'm probably missing something really obvious. I've included <MediaPlayer/MediaPlayer.h> and have this code: NSURL
This probably has a simple answer, but I must not have had enough coffee
This probably sounds really stupid but I have noo idea how to implement jquery's
Ok, this probably has a really simple answer, but I've never tried to do
This is probably a really simple jQuery question, but I couldn't answer it after
I need a little help with (probably) something really simple. I want to use
I'm probably missing something really obvious here, but I've been going over this over
I get the feeling this is probably something I should know but I can't
It's probably the tenth time I'm implementing something like this, and I've never been
This is probably best shown with an example. I have an enum with attributes:

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.