title: PagedList loses search filter on second page
body: <p>I'm implementing a simple paged list Index using the example at <a href="http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-application">http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-application</a></p>
  
  <p>My problem is that the search string is 'lost' when I page to the second page, so instead of a filtered set of results, I'm shown all the records.</p>
  
  <p>My index.cshtml:</p>
  
  <pre><code>@using (Html.BeginForm("Index", "", FormMethod.Get))
  {
      &lt;p&gt;
          @Html.TextBox("searchString", ViewBag.currentFilter as string, new { @placeholder = "Search by title or author" })
          &lt;input type="submit" value="Search" /&gt;
      &lt;/p&gt;
  }
  
  @if (Model.PageCount &gt; 1)
  { 
      @Html.PagedListPager( Model, page =&gt; Url.Action("Index", new { page }) )
  }
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>public ViewResult Index(string sortOrder, string currentFilter, string searchString, int? page)
      {
          ViewBag.TitleSortParm = sortOrder == "Title" ? "Title desc" : "Title";
          ViewBag.AuthorSortParm = sortOrder == "Author" ? "Author desc" : "Author";
          ViewBag.DateSortParm = sortOrder == "Date" ? "Date desc" : "Date";
  
          if (searchString != null)
          {
              page = 1;
          }
          else
          {
              searchString = currentFilter;
  
          }
  
          ViewBag.currentFilter = searchString;
  
          var Articles = from a in db.Articles
                         select a;
          if (!String.IsNullOrEmpty(searchString))
          {
              //page = 1;
              Insights = Articles.Where(s =&gt; s.Title.ToUpper().Contains(searchString.ToUpper())
                                 || s.Author.ToUpper().Contains(searchString.ToUpper()));
          }
  
          switch (sortOrder)
          {
              case "Author":
                  Insights = Articles.OrderBy(s =&gt; s.Author);
                  break;
              case "Author desc":
                  Insights = Articles.OrderByDescending(s =&gt; s.Author);
                  break;
              case "Title":
                  Insights = Articles.OrderBy(s =&gt; s.Title);
                  break;
              case "Title desc":
                  Insights = Articles.OrderByDescending(s =&gt; s.Title);
                  break;
              case "Date":
                  Insights = Articles.OrderBy(s =&gt; s.DatePublished);
                  break;
              default:
                  Insights = Articles.OrderByDescending(s =&gt; s.DatePublished);
                  break;
          }
          int pageSize = 3;
          int pageNumber = (page ?? 1);
          return View(Articles.ToPagedList(pageNumber, pageSize));
  
      }
  </code></pre>
  
  <p>When I go to Page 2 as an example, all my variables, sortOrder, currentFilter and searchString are all null.</p>
  
  <p>Robbie</p>