ASP.NET MVC Pagination Not Working on ViewModel
问题 I am using pagination in my project. I have search box and sending searching text to Action Result. I hitted break point to Search ActionResult. My news and announcements are filling after select queries. Search ActionResult public ActionResult Search(string searchText,int? page) { int pageIndex=page??1; int dataCount=20; dbContext=new dbContext(); SearchViewModel searchViewModel=new SearchViewModel(); var news=(from news in dbContext.News where news.Title.Contains(searchText) select news)