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.
Try <%= Employee.FirstName %>
Since you instantiate your object as Public you should be able to call it, even from aspx page.
<%#Eval(employee.FirstName)%>
If you are trying to access something inside a databound control, use:
<%#Eval(employee.FirstName)%>
For general us in a .aspx or .ascx, use:
<%#Eval(employee.FirstName)%>
精彩评论