I used to be able to do the following in Preview 3
<%=Html.BuildUrlFromExpression<AController>(c => c.AnAction(par1, par2)%>
How am I supposed to create urls in a strongly typed way with the MVC Beta? The only thing so far I have found is
<%= Html.ActionLink("aName", "ActionName", "ControllerName")%>
This is not strongly typed off course.
You need the ASP.NET MVC Beta Futures, which is a separate download
then your original code will work as before.
See this post for getting it working: SO post on missing extensions
The Microsoft.Web.Mvc
assembly provides extension methods to the HtmlHelper
which allow something like
<%= Html.ActionLink<SomeController>(c => c.Index()) %>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.