DataBinding Static Methods!

Discussion in 'ASP .Net' started by Adam J Knight, Feb 18, 2006.

  1. Hi all,

    I have created a class that contains static method; these method return db

    If i use the following code in my code behind all works fine:
    ddlMyDropDownList.DataSource = myClass.GetData()

    If i code it into my page like so:
    <asp:DropDownList ID="test" DataSource="<%# myClass.GetData()%>"

    I get an error saying myClass is not availble in this context ect..

    Any thoughts..???

    Adam J Knight, Feb 18, 2006
    1. Advertisements

  2. Kris

    Kris Guest

    Hi Adam,

    Have you imported myClass namespace in .aspx page. If not import the
    namespace in you .aspx page.

    <%@ Import NameSpace = "namespace"%>

    Kris, Feb 18, 2006
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.