Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The querystring you presented should work (try it directly in the browser to make sure).</p> <p>Where you'll have an issue is when someone clicks the navigation links because the <code>query</code> parameter isn't accounted for in your <code>Html.ActionLink</code> calls. As this is homework I'll leave that as an exercise for the reader = p</p> <p>Honestly, though. You should be able to figure it out from there. If not comment and I'll chime in again.</p> <p>-cheers</p> <p><strong>update</strong></p> <p>So here is what you currently have your next link:</p> <pre><code>&lt;%= Html.ActionLink("Next Page &gt;&gt;", "Index", new { page = (Model.PageIndex + 1) })%&gt; </code></pre> <p>What you need to do is add query as another parameter to the ActionLink. However before you do that you need to capture the query string somewhere in your model. The dirty way of doing this is adding the query value to the ViewData and passing it that way; the clean way is adding a variable to your paginatedList class to hold the current query and setting it in the model. i.e</p> <pre><code>ViewData["query"] = query; </code></pre> <p>Or if you choose the model route:</p> <pre><code>paginatedList.Query = query; </code></pre> <p>Then you could do something like the following:</p> <pre><code>&lt;%= Html.ActionLink("Next Page &gt;&gt;", "Index", new { Page = (Model.PageIndex + 1), query = ViewData["query"] /*or Model.Query */ })%&gt; </code></pre> <p>I'm not sure how you re-setup your routing, but something similar to the above should work. You could also cache the <code>IQueryable</code> object, or even just the string query itself, but that's a whole other layer of abstraction.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload