DataBinding Static Methods!

A

Adam J Knight

Hi all,

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

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()%>"
Runat="server"/>

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

Any thoughts..???

Cheers,
Adam
 
K

Kris

Hi Adam,

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

<%@ Import NameSpace = "namespace"%>

Cheers,
Kris
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Static Methods!!! 2
Double databinding 1
Static Method? 2
static data for methods... 10
DataBinding problems 1
Registration Form 7
Databinding 1
FormView/Insert template / DropdownList / DataBinding 1

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top