Razor support of generic extension methods

Posted by Brian on Stack Overflow See other posts from Stack Overflow or by Brian
Published on 2011-02-11T04:39:55Z Indexed on 2011/02/11 7:25 UTC
Read the original article Hit count: 230

Hello,

With regards to the Razor view engine, say I want to render Html.TextBoxFor<SomeModel>(i => i.Name), it doesn't seem that the inline syntax works as in:

@Html.TextBoxFor<SomeModel>(i => i.Name)

This doesn't seem to work because it interprets the generic as an HTML tag. I could use a code-block approach, but then what's the best approach to output the content? The HTML string returned from this method, do I response.write it, or is there a syntax for it, or what's the approach?

Thanks.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc