Have you added helper namespace to your Views / web.config?
<system.web.webPages.razor> <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <pages pageBaseType="System.Web.Mvc.WebViewPage"> <namespaces> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> <add namespace="CUSTOM_NAMESPACE" /> </namespaces> </pages> </system.web.webPages.razor>
The above will only work if you use RC, if you are in an early beta, you will need to add a namespace on the page or Global.asax.
In addition, I would suggest changing the return type to HtmlString .
return new HtmlString(STRING_VALUE);
kim3er
source share