views:

95

answers:

2

I need to execute a method within an ItemTemplate in my DataList. How do I format the method in the page to work correctly with an Eval?

The method takes an int as a parameter.

<%# NumberOfEmplyeeOrders(Int32.Parse("EmployeeID"))%>
+5  A: 

<%# NumberOfEmplyeeOrders((Int32)Eval("EmployeeID")) %>

John Saunders
A: 

I had a syntax error in my cast. Here is the correct code:

<%#NumberOfEmplyeeOrders((Int32)(Eval("EmployeeID"))) %>
Nick
you should rather accept johns answer....
Andreas Niedermair