title: Razor Not Rendering HtmlHelper Extension Method Properly
body: <p>I have a Extension method in my html helper class to render an Autocomplete. This works fine with aspx view engine in VS2008 &amp; VS2010. The Autocomplete class has an overloaded ToString() method which outputs Raw Html.</p>
  
  <p>However when i use Razor engine i don't get any visible output. Firebug shows the output of Extension method is Html Encoded as follow :(with all &amp;lt, &amp;gt..)</p>
  
  <pre><code>    &amp;lt;input class="AutoComplete" id="p_ename" name="p_ename" style="width: 190px" type="text" valuefield="p_empid"&amp;gt;&amp;lt;/input&amp;gt; &amp;lt;input id="p_empid" name="p_empid" type="hidden"&amp;gt;&amp;lt;/input&amp;gt; 
  &amp;lt;script type='text/javascript'&amp;gt;$('#p_ename').autocomplete('/UserMst/GetEmployee', { dataType: 'json', scroll: true, parse: function(item, event) { $('#p_empid').val(''); var array = new Array(); if(item) for (var i = 0; item[i]; i++ ) { array[array.length] = { data: item[i], value: item[i], result: unescape(item[i].Text) }; } return array; }, formatItem: function(row) { return unescape(row.Text); } }).result(function(event, item, formatted) { $('#p_empid').val(item.Value); }).keyup(function() { if (window.event.keyCode != 13 &amp;amp;&amp;amp; window.event.keyCode != 16 &amp;amp;&amp;amp; window.event.keyCode != 20 &amp;amp;&amp;amp; window.event.keyCode != 9 &amp;amp;&amp;amp; window.event.keyCode != 27 &amp;amp;&amp;amp; !(window.event.keyCode &amp;gt;= 112 &amp;amp;&amp;amp; window.event.keyCode &amp;lt;= 123) &amp;amp;&amp;amp; !(window.event.keyCode &amp;gt;= 37 &amp;amp;&amp;amp; window.event.keyCode &amp;lt;= 40)) { $('#p_empid').val(''); } });
  &amp;lt;/script&amp;gt;
  </code></pre>
  
  <p>And this is how I call the method :</p>
  
  <pre><code>@Html.AutocompleteFor(m =&gt; m.p_empid, m =&gt; m.p_ename)
  .setUrl(VirtualPathUtility.ToAbsolute("~/UserMst/GetEmployee"))
  .setClass("AutoComplete").setStyle("width: 190px")
  </code></pre>
  
  <p>How do i fix this to work with Razor in MVC3 ?</p>
  
  <p>Thanks</p>