title: MVC Dialog - Get an Id value from an Action Link
body: <p>In my application I have some table data that looks like this:</p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;Actions&lt;/th&gt;
          &lt;th&gt;Text&lt;/th&gt;
      &lt;/tr&gt;
      @foreach( var item in Model.Items ) {
      &lt;tr&gt;
          &lt;td&gt;
              @Html.ActionLink("Edit", "Edit", "Items", new { @class = "edit-item-link", id = "edit-item-" + item.Id })
              @Html.ActionLink("Delete", "Delete", "Items", new { @class = "delete-item-link", id = "delete-item-" + item.Id })
          &lt;/td&gt;
          &lt;td&gt;@item.Text&lt;/td&gt;
      &lt;/tr&gt;
      }
  &lt;/table&gt;
  </code></pre>
  
  <p>The view will create action links like the following:</p>
  
  <pre><code>&lt;a href="/Items/Edit/1" class="edit-item-link" id="edit-item-1"&gt;Edit&lt;/a&gt;
  </code></pre>
  
  <p>I am then using jquery to override the action:</p>
  
  <pre><code>$('.edit-item-link').live('click', function(e) {
      e.preventDefault();
  
      $.ajax({
          type: 'POST',
          url: ''
          dataType: 'json'
      });
  });
  </code></pre>
  
  <p>When I pass the URL to the ajax call I want to use the following url: <code>/Items/GetItemJson/1</code></p>
  
  <p>How can I get the id value from the url without having to use a regex?</p>
  
  <p>I don't want to change the url in the action link because I will be using it in another way.</p>