Is it possible to assign an Lambda Expression (action?) to a property of my View Model, then use that expression in a Partial? What should the model's property type be? Psuedo Code:
View Model
public class MyModel
{
public ????? MyAction {get;set;}
}
Controller
public ActionResult Index()
{
var model = new MyModel();
model.MyAction = ?????<MyController>(x => x.DoThis());
return View(model);
}
public ActionResult DoThis()
{
return View();
}
Partial.ascx, How would I assign the action to the ActionLink?
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyModel>" %>
<%=Html.ActionLink<Controller>(x => x.DoThis())%>
I am using the strongly typed ActionLink from the Futures assembly.