Home Contact

Allan Rwakatungu's blog

Developer and Enterprise Architect

News

Twitter












Archives

Post Categories

Image Galleries

Syndication:

October 2009 Entries


Using strongly Typed HTML/AJAX Helpers with ASP.NET MVC

If you dont want to use strings but instead use strongly typed expression syntax in ASP.NET MVC, you can use the HtmlHelper<TModel> and AjaxHelper<TModel> types that are exposed on the ViewPage<TModel> base class. You can then write syntax like <ul> <%foreach (Product p in ViewData.Model.Products) { %> <li> <%=Html.ActionLink<Ca... %> </li> <%} %> </ul> instead of <ul> <%foreach...