title: Preserve ${name} in Url.Action route values for use with jquery.tmpl?
body: <p>I'm venturing a bit off the beaten path here, but it doesn't seem too unreasonable. </p>
  
  <p>In a view, with this code:</p>
  
  <pre><code>&lt;div&gt;Hello ${Name}&lt;/div&gt;
  </code></pre>
  
  <p>Ran through jquery.tmpl supplied with { Id: <strong>1</strong>, Name = "<strong>Bob</strong>" }, will render the following on the client:</p>
  
  <pre><code>&lt;div&gt;Hello Bob&lt;/div&gt;
  </code></pre>
  
  <p><strong>This is great and all, but let's introduce a Url:</strong></p>
  
  <p>In a view, with this code:</p>
  
  <pre><code>&lt;div&gt;Hello &lt;a href="&lt;%: Url.Action("Profile", new { id= "${Id}" }) %&gt;"&gt;${Name}&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Renders to:</p>
  
  <pre><code>&lt;div&gt;Hello &lt;a href="/User/Profile?id=%24%7BId%7D"&gt;${Name}&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p>And after ran through jquery.tmpl the encoded Id tag doesn't get picked up:</p>
  
  <pre><code> &lt;div&gt;Hello &lt;a href="/User/Profile?id=%24%7BId%7D"&gt;Bob&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I understand why this is happening, but what I'm struggling with is a way to prevent Route Values from being encoded. I lose the trail after digging around in the de-compiled code for some time, the actual mechanism for encoding eludes me. If it were me, I'd convert the Route Values to an <code>HttpNameCollection</code> and <code>ToString</code> it, such as using <code>HttpUtility.Parse()</code>.</p>
  
  <p>MVC has been amazingly flexible with things like this so I find it hard to believe I can't change the encoder or wrap route value values with an <code>MvcHtmlString</code> or something.</p>
  
  <p>How can I get a Url.Action, either be from a UrlHelper extensions or replaced and extended encoder, preserve route values with the jquery.tmpl formats: <code>${value}</code></p>