Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.Net MVC3 external data paging
    primarykey
    data
    text
    <p>I have some code to get my data using a min_row/max_row. I want to pass in the page number rom my menu as well as the paging links.</p> <p>My main menu has this code:</p> <pre><code>@Html.ActionLink("MyDocuments", "", "Home/MyDocuments/1") </code></pre> <p>My paging links look like this:<br> (they will be built on the fly from a total record count sent in the ViewBag, not done with that part yet):</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Prev&lt;/a&gt;&lt;/li&gt; &lt;li class="active"&gt;&lt;a href="/Home/MyDocuments/1"&gt;1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/Home/MyDocuments/2"&gt;2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/Home/MyDocuments/3"&gt;3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/Home/MyDocuments/4"&gt;4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Next&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Here is my controller action:</p> <pre><code>public ActionResult MyDocuments(int Page) { string min = (Page-1*50).ToString(); string max = (50 / Page).ToString(); // mps is a webservice reference Archive docs = mps.GetArchiveArray(LogonTicket, PID, "SortColumn", max, min, "ASC"); ViewBag.docs = docs; return View(); } </code></pre> <p>Now, when I click on the main menu item, I get this error:</p> <pre><code>The parameters dictionary contains a null entry for parameter 'Page' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult MyDocuments(Int32)' in 'MVC3MySite.Controllers.HomeController'. </code></pre> <p>Here is my MapRoutes in Global.asax.cs:</p> <pre><code>routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); </code></pre> <p>How do I circumvent this error?</p>
    singulars
    1. This table or related slice is empty.
    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. 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