title: How to pass parameter to jqgrid from another page
body: <p>I have dynamic button of reports name,every time the user click the button,it will display the search fields (start date,end date) which is applicable to all reports,all reports have their different page to display with their own grid and now how can I pass parameters and open the corresponding page of the report and load the jqgrid. I've been stock with this passing parameters to "OnlineSales" page and then load the grid. Thanks in advance for helping!</p>
  
  <p>After I click the search button what will be the syntax for calling the OnlineSales page and passing the parameters and then display the data in grid.</p>
  
  <pre><code>$('#SearchButton').click(function () {
              var _StartDate = $("#StartDate").val();
              var _EndDate = $("#EndDate").val();
  });
  </code></pre>
  
  <p>call OnlineSales view with parameters</p>
  
  <pre><code>@{
      ViewBag.Title = "OnlineSales";
  }
  
  @*GRID*@
      &lt;div id="table" class="table"&gt;
          &lt;table id="List" class="scroll" cellpadding="0" cellspacing="0"&gt;&lt;/table&gt;
          &lt;div id="Pager" class="scroll" style="text-align:center;"&gt;&lt;/div&gt;
      &lt;/div&gt;
  @*GRID*@
  
  &lt;script type="text/javascript"&gt;
  jQuery(document).ready(function () {
  
          jQuery("#List").jqGrid({
              url: 'local',
              postData: { start_date: '', end_date: ''},
              datatype: "json",
              mtype: 'GET',
              colNames: [
                    'First Name',
                    'Middle Name',
                    'Last Name',
                    'Email',
                    'Mobile Number'],
              colModel: [
                    { name: 'FirstName', index: 'FirstName', width: 200, align: 'left' },
                    { name: 'MiddleName', index: 'MiddleName', width: 200, align: 'left' },
                    { name: 'LastName', index: 'LastName', width: 150, align: 'left' },
                    { name: 'Email', index: 'Email', width: 150, align: 'left' },
                    { name: 'MobileNumber', index: 'MobileNumber', width: 80, align: 'left' }],
              pager: jQuery('#Pager'),
              rowNum: 10,
              rowList: [5, 10, 20, 50, 100],
              sortname: 'FirstName',
              width: '1005',
              sortorder: "asc",
              sorttype: 'int',
              viewrecords: true,
              height: 'auto',
              shrinkToFit: false,
              cache: false,
              caption: 'Online Sales'
          });
          jQuery("#List").jqGrid('navGrid', '#Pager', { edit: false, add: false, del: false, search: false, refresh: true });
  
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>My Controller</p>
  
  <pre><code>public ActionResult OnlineSales(string sidx, string sord, int page, int rows, DateTime start_date, DateTime end_date)
          {
              _DashboardDataAccess = new DashboardDataAccess(0);
              List&lt;OnlineSales&gt; _OnlineSales = _DashboardDataAccess.OnlineSales(start_date, end_date);
  
              var result = _OnlineSales.AsQueryable().AsEnumerable&lt;OnlineSales&gt;();
  
              int count = result.Count();
              result = result.Skip((page - 1) * rows).Take(rows);
              int pagecount = (count % rows) == 0 ? (count / rows) : (count / rows) + 1;
  
              var ReportList = (from r in result
                                select new
                                {
                                    cell = new string[] {
                                    r.FirstName,
                                    r.MiddleName,
                                    r.LastName,
                                    r.Email,
                                    r.MobileNumber
                                    }
                                });
              var jsonData = new
              {
                  total = pagecount,
                  page = page,
                  records = count,
                  rows = ReportList.ToArray()
              };
  
              return Json(jsonData, JsonRequestBehavior.AllowGet);
  
          }
  </code></pre>