I've created a surfacecontroller like:
[PluginController("mypluginapp")]
public class CartController : SurfaceController
{
[ChildActionOnly]
public ActionResult AddToCart( int id)
{
AddToCartViewModel vm = new AddToCartViewModel();
vm.Name = "blahhhhh";
return PartialView(vm);
}
In my top level view I'm calling the action like:
@Html.Action("AddToCart", "Cart", new {id = 1234})
I get the error on the Html.Action that it can't find the view - it should be loading:
Surface controller can't find view
Hi,
I've created a surfacecontroller like:
[PluginController("mypluginapp")] public class CartController : SurfaceController { [ChildActionOnly] public ActionResult AddToCart( int id) { AddToCartViewModel vm = new AddToCartViewModel(); vm.Name = "blahhhhh"; return PartialView(vm); }
In my top level view I'm calling the action like:
I get the error on the Html.Action that it can't find the view - it should be loading:
~/App_Plugins/mypluginapp/Views/Cart/AddToCart.cshtml
The actual error is:
The partial view 'AddToCart' was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Cart/AddToCart.aspx
~/Views/Cart/AddToCart.ascx ....
It looks like it's not searching in ~/app_plugin/..
I'm using version 7.6.0.0
Hi Rob
Did you try to define full path to partial?
Thanks,
Alex
Hi,
Yes that worked!
Would be better without the path and the viewengine picking it up.
Thanks for helping out!
Thanks
Rob
is working on a reply...