0
我想将routeValues作为复杂的数据类型传递给HtmlHelper,而不是使用匿名类型。MVC:从复杂数据类型中提取RouteValues
例如,
@Html.Navigator("Title", Model.SearchCriteria)
,而不是
@Html.Navigator("Title", new {startDate=Model.StartDate, filter=Model.Filter, ...and so on})
对于后者我用:
public static MvcHtmlString Navigator(this HtmlHelper html, string title, object routeValues)
anchorBuilder.MergeAttribute("href", url.Action(action, routeValues));
添加routeValues。
无法找到SearchCriteria的操作方法。 任何建议,指针..?
问候,盖伊