Last post Oct 14, 2013 05:38 AM by Starain chen - MSFT
Oct 11, 2013 05:43 AM|xutean|LINK
Can I use strongly typed html helper in webmatrix 3 such as @Html.TextBoxFor
Oct 11, 2013 02:02 PM|Mikesdotnetting|LINK
No. The Web Pages framework has its own version of Html helpers. They are not the same as the ones in MVC. There is no concept of a strongly-typed model in Web Pages so strongly typed helpers are not needed there. If you feel the need for that kind of component,
Microsoft would recommend you use MVC instead of Web Pages.
Oct 14, 2013 05:38 AM|Starain chen - MSFT|LINK
Thanks for your post!
First, please refer to Mikes's reply.
Secondly, you could consider to extend the HtmlHelper to achieve that you want, such as:
public static class MyExtension
public static IHtmlString TestBoxFor<T>(this System.Web.WebPages.Html.HtmlHelper helper,T d)
return new HtmlString("<Input type=\"text\" value=\"v1\"/>");
FeedItem f=new FeedItem();