title: MVC Webgrid, javascript stops working after sort and paging
body: <p>I have a problem with my webgrid, in one of my columns I have an actionlinks that has a JavaScript with a click function, everything works fine. But after I have sorted any column or paging the grid my JavaScript stops working. I have removed the <code>ajaxupdatecontainerID</code> property and my JavaScript works after paging but I can´t sort my columns anymore and after paging the browser scrolls to top of the page. check my code below:</p>
  
  <pre><code>&lt;div id="grider"&gt;
      @{ var grid3 = new WebGrid(Model.webgridlastlopp.ToList(), rowsPerPage: 10, defaultSort: "Status", canPage: true, ajaxUpdateContainerId: "grider");}
      @grid3.GetHtml(tableStyle: "webgrid",
                          headerStyle: "webgrid-header",
                          footerStyle: "webgrid-footer",
                          alternatingRowStyle: "webgrid-alternating-row",
                          selectedRowStyle: "webgrid-selected-row",
                          rowStyle: "webgrid-row-style",
                          grid3.Column("Startstation", "Start station/kombiterminal"),
                                                grid3.Column("Slutstation", "Slut station/kombiterminal"),
                                                grid3.Column("Upphämtningsdatum", "Startdatum", format: @&lt;text&gt;@item.Upphämtningsdatum.ToString("yyyy/MM/dd")&lt;/text&gt;),
                                                grid3.Column("Leveransdatum", "Leveransdatum", format: @&lt;text&gt;@item.Leveransdatum.ToString("yyyy/MM/dd")&lt;/text&gt;),
                                                grid3.Column(format: (item) =&gt; Html.ActionLink("Visa detaljer", "OrderDetails", "Home", new { id = item.Ordernummer }, new { @class = "modal", @Style = "color:Gray;" }))
                                                ))
    &lt;/div&gt;
    &lt;script type="text/javascript"&gt;
          $(function () {
              $('.modal').click(function () {
                  alert("hello");
          });
    &lt;/script&gt;
  </code></pre>