I have a search page with which the webgrid is populated upon loading. My problem is with the search call. When I download, I fill out the "Unpublished" article grid (in this case, there are none). Then I search for โCurrently Publishedโ and get 3 lines.
Now I have 3 pages (for testing, I set the swap to one line per page). The first time he searches - he gets the correct answers in the grid, nd lets you say that there are 2 pages.
If I press 2 to go to the second page - the grid is filled with load criteria - which is not published, of which there are none. I see that I will not return to the HttpPost action on the page click, so I'm not sure why it does this.
You can see that I have a bootstrap called Admin and Post called Admin (FormCollection values) On both I set the default values โโto "Not Published"
public ActionResult Admin() { var menus = ( from p in db.Menus.ToList() where p.ParentID == 0 orderby p.Order ascending select p.Name ); ViewBag.Menus = new SelectList(menus, "Home"); string[] publishedStatuses = new string[3] { "NOT PUBLISHED", "EXPIRED ALREADY", "CURRENTLY PUBLISHED"}; ViewBag.Published = new SelectList(publishedStatuses, "NOT PUBLISHED"); var articles = ( from p in db.Articles.ToList() where p.PublishToWeb == false && p.Menu == "Home" select p ); } return View(articles); } }
source share