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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:36:57+00:00 2026-05-24T16:36:57+00:00

I have a Dropdown List in the asp page which I bind it in

  • 0

I have a Dropdown List in the asp page which I bind it in codebehind.

 <asp:DropDownList ID="authorList" runat="server"></asp:DropDownList>

In C#,

  PublishingCompanyEntities p = new PublishingCompanyEntities();
        var a = (from s in p.Authors
                 select s.FirstName);
        authorList.DataSource = p.Authors;
        authorList.DataTextField = "Firstname";
        authorList.DataValueField = "FirstName";

where PublishingCompanyEntities is an entity class got using ADO.NET Entity model. However, the dropdownlist is not getting binded. Can u let me know the mistake I’ve been making?

  • 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-24T16:36:59+00:00Added an answer on May 24, 2026 at 4:36 pm

    Try calling the .DataBind() method on the drop down after assigning the DataSource property:

    authorList.DataBind();
    

    Contrary to WinForms, in ASP.NET you need to invoke this method explicitly.

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

Sidebar

Related Questions

I have a this aspx-code: (sample) <asp:DropDownList runat=server ID=ddList1></asp:DropDownList> With this codebehind: List<System.Web.UI.WebControls.ListItem> colors
I have a page which contains the generated content. Page.aspx: <asp:DropDownList ID=cmbUsers runat=server AutoPostBack=True
I have two dropdown lists: <asp:DropDownList ID=Field_Type runat=server /> <asp:DropDownList ID=Field_SubType runat=server /> Field_Type
I have small page which has label, DropDownList and a submit button. <div> <asp:label
I have a basic DropDownList bound to a ObjectDataSource: <asp:DropDownList ID=DropDownList1 runat=server AutoPostBack=True DataSourceID=objDataSource1
I have the webform with dropdown list, label and textbox. Like below: <asp:DropDownList ID=ddlTest
I have an ASP.NET DropDownList control that renders into a dropdown list (select HTML
i have an asp.net mvc page and i want to have a dropdown list
I have a Datagrid which looks as under <asp:GridView ID=dgTask runat=server Width=100% AutoGenerateColumns=False> <Columns>
Greetings! I have a DropDownList within a FormView which are bound to XmlDataSources: <asp:FormView

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.