ASP.NET C# Dynamic DropDown not loading

Posted on 2013-10-18
Medium Priority
Last Modified: 2013-10-30
I have a drop down list that I have to make dynamic.  It is using a home grown Entity framework 4 to retrieve the data.  I have everything else loading like email, phone number etc..  It is the drop-down that isn't showing the name from a table in the database.  I will attach the aspx page and the code behind so you can see what I am talking about. The drop down that isn't work is the first one ddlName.  The other drop downs are fine. Thanks for any help.
Question by:tonymm73
  • 2
  • 2
LVL 15

Expert Comment

ID: 39583033
I read your code

You need to provide a datasource for ddlName

ddlName.Datasource ="MydataSource"

I don't see this in your code.

Accepted Solution

tonymm73 earned 0 total points
ID: 39583106
I see what you mean but this is where my problem is.  If I was going to a SQL database or Entity Framework I would know what to do.  The problem is I have to grab everything from methods in a page called RequestTracker.cs  The RequestTracker.cs page goes to entity RequestTracker.edmx.  I can't change this because the rest of the application uses this.   So I am getting the names from a Method that are in the RequestTracker.cs.  This is my first post and I am not sure if I can post those pages as well.  I will try after this reply.  I appreciate the help.
LVL 15

Expert Comment

ID: 39583561
So use or create a method in  RequestTracker.cs that returns a Dataset and use it to bind your drop down to.

Author Closing Comment

ID: 39611016
You were right I din't have this coded correctly. ddlName.Datasource ="MydataSource"

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
SingleRun is a tool that ensures that only one instance of an application is started, running it again brings the application to focus.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
From store locators to asset tracking and route optimization, learn how leading companies are using Google Maps APIs throughout the customer journey to increase checkout conversions, boost user engagement, and optimize order fulfillment. Powered …
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question