Note that I've found multiple workarounds, but I wonder why this seemingly obvious approach doesn't seem to be supported like it is in normal MVC (namely, the overload of System.Web.Mvc.Controller.View that accepts a model instance).
Note that my favorite workaround is this, though I don't much like hardcoding view paths in action methods (especially since the user can potentially change the template in the CMS):
public class SomePageSurfaceController : SurfaceController
{
[HttpPost]
public ActionResult SomeMethod()
{
var model = SomeNamespace.SomeClass.SomeLogic(CurrentPage);
return View("~/Views/SomeView.cshtml", model);
}
}
Return Model From SurfaceController?
Why isn't there an overload of Umbraco.Web.Mvc.SurfaceController.CurrentUmbracoPage that accepts a model to propagate to the view?
Note that I've found multiple workarounds, but I wonder why this seemingly obvious approach doesn't seem to be supported like it is in normal MVC (namely, the overload of System.Web.Mvc.Controller.View that accepts a model instance).
Note that my favorite workaround is this, though I don't much like hardcoding view paths in action methods (especially since the user can potentially change the template in the CMS):
is working on a reply...