Note that there are some explanatory texts on larger screens.

plurals
  1. POomit post back in making ( << 1 2 3 4 >> )
    text
    copied!<p>i wanna make some thing like this ( &lt;&lt; 1 2 3 4 >> ) end of my view . i used HTML.BeginForm and it worked .but i had post back.so i changed HTML.BeginForm to Ajax.BeginForm , now it dose not work.</p> <p>for example when i click on link 2 i get this error in fire bug :</p> <pre><code> " NetworkError: 500 Internal Server Error - http://localhost/myAction/search? pagenumber=2" </code></pre> <p>view:</p> <pre><code> @using (Ajax.BeginForm( "search ","MyAction",new AjaxOptions { HttpMethod = "POST", InsertionMode = InsertionMode.Replace, UpdateTargetId = "" })) { int page = (int)ViewBag.page; int pages = (int)ViewBag.pages; &lt;div class="pagination pagination-left"&gt; &lt;ul&gt; &lt;li&gt;@Ajax.ActionLink("«", "MyAction", new { numberpage = pages })&lt;/li&gt; @{for (int i = pages; i &gt;= 1; i--) { if (i == page) { &lt;li class="active"&gt;@HtmlAjax.ActionLink(i.ToString(), " MyAction ", new { numberpage = i })&lt;/li&gt; } else { &lt;li&gt;@Ajax.ActionLink(i.ToString(), " MyAction ", new { numberpage = i })&lt;/li&gt; } } } &lt;li&gt;@Ajax.ActionLink("»", " MyAction ", new { numberpage = 1 })&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>my controller :</p> <pre><code> [HttpPOST] public ActionResult search(int? numberpage) { int skip = 0; ViewBag.page ; Temp= myobjectclass.GetAll().tolist(); ViewBag.pages = (Temp.Count() / 5) + 1; var db = new ProjectContext(); var obj = new projectClass.myobjectclass(); if (numberpage!= null) { skip = 5 * (numberpage.Value - 1); ViewBag.page = numberpage.Value; } obj.StudentRequierments = Temp.Skip(skip).Take(5).ToList(); ViewBag.pages = (Temp.Count() / 5) + 1; return View(obj); </code></pre>
 

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