title: ASP.NET MVC. PagedList filtering by multiple params
body: <p>I have a web page with filter params and created simple class to proceed that params by <strong>Where()</strong> method.</p>
  
  <p>But there is one problem to pass the params by Html.Action.</p>
  
  <p>Search Options:</p>
  
  <pre><code>public class Document
  {
      public string Name { get; set; }
      public string Title { get; set; }
      public string Param1{ get; set; }
      public string Param2{ get; set; }
  }
  </code></pre>
  
  <p>Controller Action</p>
  
  <pre><code> public ActionResult Index(int? page, Document filter)
      {
          ViewBag.Params= documentFilter;
          IEnumerable&lt;Document&gt; DocumentList = dbContext.Documents.ToList();
          DocumentList = DocumentList.CustomFilter(documentFilter);
          var pageNumber = page ?? 1;
          var onePageOfProducts = DocumentList.ToPagedList(pageNumber, 50);
          ViewBag.Documents = onePageOfProducts;
          return View();
      }
  </code></pre>
  
  <p>The filtering works good, but if you use paging control, params will lose.</p>
  
  <p>Paging helper:</p>
  
  <pre><code>@Html.PagedListPager((IPagedList)ViewBag.Documents, 
  page =&gt; Url.Action("Index", new { page , filter = (Document)ViewBag.filter}))
  //Also tried Model instead of ViewBag.filter
  </code></pre>
  
  <p>I couldn't pass the params to action control.</p>
  
  <p>Is there any way to do this? </p>