H
hsomob1999
I retreive a class in my code behind and would like to bind it to a
label and some <td>'s.
Idealy I would like to say:
<asp:label .....><%#myClass.publicProperty%></asp:label>
but myClass is retreived in a codebehind sub.
Since the class doesnt implement IEnum or isnt contained in some
container ( its an instance of a single Employee ) I cant use
Label.DataBind().
I have thought to make a sub in my code behind called getEmployee()
then in the asp page say that inherrits from it say:
<%
e = getEmployee()
label1.text = e.name
%>
etc....
but would like to keep with the format of the other data on my page and
bind it.
That being said I would also like to avoid making public properties on
my code behind and and say stuff like <asp:label
....><%#getName()%></asp:label>
or making asignments from my code behind like
Label1.text = e.Name()
Any Ideas?
Thanks
label and some <td>'s.
Idealy I would like to say:
<asp:label .....><%#myClass.publicProperty%></asp:label>
but myClass is retreived in a codebehind sub.
Since the class doesnt implement IEnum or isnt contained in some
container ( its an instance of a single Employee ) I cant use
Label.DataBind().
I have thought to make a sub in my code behind called getEmployee()
then in the asp page say that inherrits from it say:
<%
e = getEmployee()
label1.text = e.name
%>
etc....
but would like to keep with the format of the other data on my page and
bind it.
That being said I would also like to avoid making public properties on
my code behind and and say stuff like <asp:label
....><%#getName()%></asp:label>
or making asignments from my code behind like
Label1.text = e.Name()
Any Ideas?
Thanks