title: Using Url.Action in javascript
body: <p>I am trying to use the Url.Action method to correctly generate the required Url for an ajax call but I'm running into problems when trying to build the RouteValues, here's the problem line of code:</p>
  
  <pre><code>var url = @Url.Action("ViewFile", "Default", new { itemId = $(this).data("itemid") });
  </code></pre>
  
  <p>As you can see, I'm trying to assign the result of the JQuery <code>$(this).data("itemid")</code>
  to <code>itemId</code> in the RouteValues.</p>
  
  <p>Is there a way using razor syntax which will allow this code to compile?</p>