I\'d like to use a LinqDataSource
control on a page and limit the amount of records returned. I know if I use code behind I could do something like this:
Yes and No.
No, you cannot limit the results within the LinqDataSource control. Because Linq uses deferred execution, the expectation is that the presentation control will do the recordset limits.
Yes, you can do this with a ListView control. The trick is to use the DataPager control within the LayoutTemplate, like so:
Normally, you would include controls inside the DataPager like first, last, next, and previous. But if you just make it empty, then you will only see the three results that you desire.
Hope this helps.