Getting DataBinder Item's max value

Posted by iTayb on Stack Overflow See other posts from Stack Overflow or by iTayb
Published on 2010-03-30T17:42:54Z Indexed on 2010/03/30 23:33 UTC
Read the original article Hit count: 585

Filed under:
|
|

I'm working at the aspx page, and the following code is inserted in a Repeater control:

<%# ((System.Collections.Generic.List<double>)DataBinder.Eval(Container.DataItem, "BookPrices")).Max() %>

Brings up the following error: 'System.Collections.Generic.List<double>' does not contain a definition for 'Max'

List does have an method of Max(), so I'm possibly messing up my code somehow. What is my problem? BookPrices is a list<double> object, which I'd like to print it's maximum value.

P.S. You guys are great! I didn't find answers for many of my questions on the web. You really are life savers. Thank you very much! :)

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET