tiotolboflam
New Member
I'm trying to use an AJAX postback to update a container using pagedlist in asp.net.For some reason, the previous and first page actions work, although both take me to the first page. The other two don't do anything;JQuery:\[code\]<script type="text/javascript">$(document).ready(function () { $('#FirstPage').click(function () { FirstPage(); }); $('#PrevPage').click(function () { PreviousPage(); }); $('#NextPage').click(function () { NextPage(); }); $('#LastPage').click(function () { LastPage(); }); function FirstPage() { $.ajax({ type: 'post', url: "Store/Index", data: { GradeID: "@Model.GradeID", Search: "@Model.SearchString", Page: 1 }, dataType: "text", success: function (result) { $('#StoreIndex').html(result); } }); } function PreviousPage() { $.ajax({ type: 'post', url: "Store/Index", data: { GradeID: "@Model.GradeID", Search: "@Model.SearchString", Page: "@Model.GradeStores.PageNumber - 1" }, dataType: "text", success: function (result) { $('#StoreIndex').html(result); } }); } function NextPage() { $.ajax({ type: 'get', url: "Store/Index", data: { GradeID: "@Model.GradeID", Search: "@Model.SearchString", Page: "@Model.GradeStores.PageNumber + 1" }, dataType: "text", success: function (result) { $('#StoreIndex').html(result); } }); } function LastPage() { $.ajax({ type: 'post', url: "Store/Index", data: { GradeID: "@Model.GradeID", Search: "@Model.SearchString", Page: "@Model.GradeStores.PageCount" }, dataType: "text", success: function (result) { $('#StoreIndex').html(result); } }); }});\[/code\]HTML:\[code\]<div>Page @(Model.GradeStores.PageCount < Model.GradeStores.PageNumber ? 0 : Model.GradeStores.PageNumber)of @Model.GradeStores.PageCount@if (Model.GradeStores.HasPreviousPage){ @Html.ActionLink("<<", null, null, new { id = "FirstPage" }) @Html.Raw(" "); @Html.ActionLink("< Prev", null, null, new { id = "PrevPage" })}else{ @:<< @Html.Raw(" "); @:< Prev}@if (Model.GradeStores.HasNextPage){ @Html.ActionLink("Next >", null, null, new { id = "NextPage" }) @Html.Raw(" "); @Html.ActionLink(">>", null, null, new { id = "LastPage" })}else{ @:Next > @Html.Raw(" ") @:>>}\[/code\]Paging works fine if I avoid the Jquery, so the error must be here somewherem but I just cannot see what I've one wrong.By the by, my Index controller accepts \[code\](string GradeID, string Search, int? Page)\[/code\]