title: jQuery/ASP.Net MVC passing id variable to content.load
body: <p>This will probably be a rather simple question.</p>
  <p>How do I pass:</p>
  <p><code>var ident = $(this).attr(&quot;id&quot;);</code></p>
  <p>to</p>
  <p><code>content.load(&quot;@Html.Raw(Url.Action(&quot;Action&quot;, &quot;Controller&quot;, new {id=ident}))&quot;);</code></p>
  <p>I've tried:</p>
  <p><code>... new {id=&quot;+ident+&quot;}))&quot;);</code> but it doesn't work.</p>
  <h1>Solution</h1>
  <p>For my specific problem, the best solution I found was the following:</p>
  <pre><code>var ident = $(this).attr(&quot;id&quot;);
  var route = &quot;@Html.Raw(Url.Action(&quot;Action&quot;, &quot;Controller&quot;))&quot;;
  var url = addParameterToURL(route, ident);
  content.load(url);
  </code></pre>
  <p>With the method:</p>
  <pre><code>function addParameterToURL(url, param) {
      _url = url;
      _url += (_url.split('/')[1] ? '/' : '/') + param;
      return _url;
  }
  </code></pre>