Why do ASP.NET MVC HTML Helpers return MvcHtmlString instances? It seems rather inefficient to allocate a string for each rendered helper in a page. Why don’t Helpers work the same way as WebForms Controls by rendering directly to a HtmlTextWriter?
Why do ASP.NET MVC HTML Helpers return MvcHtmlString instances? It seems rather inefficient to
Share
MVC Views can be used not only to produce HTML, but as a templating system used, for example, to produce e-mails. You will easily find here, on StackOverflow, method to render view directly to string. This also gives you easier possibility to test your views.