tags:

views:

31

answers:

2

C# or VB.NET are welcome.

I have an <%#Eval("FirstName")%> in the aspx page, I want to replace "FirstName" to <%#Eval(employee.FirstName)%> but "employee" object is instantiated in the codebehind like this:

Public employee As New Employee
  • How can I call this object in the aspx page?

  • Should I can create an "employee" in the aspx? if so, how to do that.

+3  A: 

Try <%= Employee.FirstName %>

Slavo
yes , correct solution
mahmoud
+1 don't need the eval. Also if the OP needs it to happen during databinding, would just <%# Employee.FirstName %>
eglasius
+1  A: 

Since you instantiate your object as Public you should be able to call it, even from aspx page.

<%#Eval(employee.FirstName)%>

Angkor Wat