Reputation: 2295
This script works well in MVC 1, however I get "invalid arguments error" in MVC2: this.menuItems.Add("action", Html.ActionLink("action", "view", "Controller"));
Upvotes: 0
Views: 92
Reputation: 6078
In MVC2, ActionLink returns an MvcHtmlString, and menuItems.Add likely expects a string. So this should work:
this.menuItems.Add("action",
Html.ActionLink("action", "view", "Controller").ToString());
Upvotes: 1