Problem with datalist

Posted on 2005-04-19
Last Modified: 2010-04-07
I'm converting an app written using the pure .net framework from command line, to Visual studio 2003. Having a problem with the datalist that wasnt there before:

e:\inetpub\wwwroot\WebApplication2\winelist.aspx.cs(38): The type or namespace name 'MyList' could not be found (are you missing a using directive or an assembly reference?)

MyList.DataSource = productlist.gettheitems(color, category, year, region, appellation, country);

What am I missing?

Question by:dprasad
    LVL 12

    Assisted Solution

    You need to add a definition for MyList in your code behind.

    System.Data.DataList MyList;
    LVL 6

    Accepted Solution

    Check these things.

    Where there is declaration of datalist in aspx page check here

    There should be id assigned which should be  ID = "MyList"

    there should be runat=server.

    And in your class declaration in winelist.aspx.cs file

    public class winelist: Page{
        //check for this
        protected DataList MyList;

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now