Problem is I try one thing, then get one error, I then try something else and get another error etc.
I have the following code:
///
///***Pass in search parameters***
///
var r = _IGSETR.getSearchResults(strSearchPhrase,
strMode,
intPageNumber,
intRecordsPerPage,
intPagesInNavigation);
///
///***Get total number of records returned***
///
var sr = (from sd in r.AsEnumerable()
select new {
TotalRecords = sd.IntReturnCode});
int strTotalRecords = 0;
foreach (var dr in sr)
{
strTotalRecords = dr.TotalRecords;
}
ViewBag.TotalRecords = String.Format("{0:#,#}", strTotalRecords);
Any help would be appreciated
Thanks
Made redundant and now looking to build website that i always wanted to. (I'm not a professional programmer, just teaching myself)
CareerChange
Member
43 Points
180 Posts
PagedList
Dec 05, 2012 10:07 PM|LINK
Hi
Can anyone help with paging using PagedList, I'm trying to follow the examples from https://github.com/TroyGoode/PagedList
Problem is I try one thing, then get one error, I then try something else and get another error etc.
I have the following code:
/// ///***Pass in search parameters*** /// var r = _IGSETR.getSearchResults(strSearchPhrase, strMode, intPageNumber, intRecordsPerPage, intPagesInNavigation); /// ///***Get total number of records returned*** /// var sr = (from sd in r.AsEnumerable() select new { TotalRecords = sd.IntReturnCode}); int strTotalRecords = 0; foreach (var dr in sr) { strTotalRecords = dr.TotalRecords; } ViewBag.TotalRecords = String.Format("{0:#,#}", strTotalRecords);Any help would be appreciated
Thanks
ignatandrei
All-Star
134871 Points
21618 Posts
Moderator
MVP
Re: PagedList
Dec 06, 2012 01:46 AM|LINK
Please show code and error.
CareerChange
Member
43 Points
180 Posts
Re: PagedList
Dec 06, 2012 07:19 AM|LINK
Hi ignatandrei
Sometimes i cannot see the wood for the trees, I added using PagedList.MVC, but I forgot to add: using PagedList;
Thanks for the reply
Plus by the way I enjoyed your article:
http://msprogrammer.serviciipeweb.ro/2010/03/29/asp-net-mvc-orm-and-viewmodels/