title: MVC WebGrid Custom URL's For Sorting & Paging
body: <p>I have been trying to fin a way to override the URL generated for sorting &amp; paging. As i need to put a session ID in the URL that it generates. I have tried putting in custom formats. But that didn't work. It there an easier way?</p>
  
  <pre><code>@{
  var grid = new WebGrid(canPage: true, canSort: true, ajaxUpdateContainerId: "grid", rowsPerPage: @Model.Paging.PageSize, defaultSort: "Test");
  grid.Bind(Model.TestUnit, rowCount: Model.Paging.TotalRecordCount, autoSortAndPage: false, );
  grid.Pager(WebGridPagerModes.FirstLast, firstText: "First", lastText: "Last");
  @grid.GetHtml(htmlAttributes: new { id = "grid" }, tableStyle: "table table-striped table-hover",
      columns: grid.Columns(
      grid.Column("", format: @&lt;img class="thumb" src="#" height="35" width="35" alt="" /&gt;),
      grid.Column("Test", header: "Test"),
      grid.Column("Test2", header: "Test2"),
      grid.Column("", format: @&lt;text&gt;@Html.ActionLink("Details", "Details", new { id = item.test}) &lt;/text&gt;, canSort: false)
                              ));
  }
  </code></pre>