1

I am relatively new at using ASP.NET MVC, however I have got experience with using Web Forms.

My page has some cascading selects which in turn ajax load the next and finally reload the contents of the ajax tabs (jQuery UI).

One of the tabs has a search button which when submitted via jQuery loads a partial view into the given div using the code below:

      $("#frm_Search").submit(function (e) {
          if ($("#frm_Search").valid()) {
              e.preventDefault();
              $.post('@Url.Action("SearchResult", "Info")', {CCode:"", Period:"201108", Type:"XYZ"}, function (result) {
                  $('#div_SearchResult').html(result);
              });
          }

      })

However when I click on the paging links for the WebGrid the parameters get nulled and thus no data rendered.

I would be greatful for any advice or guidance as I am unsure if I am going about solving this problem correctly.

See the below diagram for a clearer indication of my page structure.

enter image description here

ShareChiWai
  • 298
  • 3
  • 8

1 Answers1

1

The problem is the Webgrid's self-generated paging links do not propagate any QSPs other than the ones it needs. This also causes headaches for people trying to add filtering to the Webgrid.

I have an answer on another question that shows how you can facilitate getting QSPs back into the page links, but it involves generating them yourself via a Razor helper.

Asp.net Mvc3 webgrid and paging There are code fragments in there to inspire you.

Community
  • 1
  • 1
escape-llc
  • 1,295
  • 1
  • 12
  • 25