Plugin partial view

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 anni tempo fa
I'm trying to return a partial view from a plugin with no luck.
am i missing something?
12 anni tempo fa
If haven't tried it (don't have access to dev machine now), but you can return a normal view (not partial) and set its 'Layout' property to 'null' (in your view)
12 anni tempo fa
Hi,try this

in the Keem_CatalogController which is in my plugin

namespace Keem.Plugin.WhatEver.Controllers
{
    public class Keem_CatalogController : BaseNopController
    {
        [ChildActionOnly]
        public ActionResult Check(int ProductId)
        {
            var model = new CheckModel();
             //some code
            return PartialView("Keem.Plugin.WhatEver.Views.Catalog._Check",model);
        }
}
}

In the view in which we want to use partialview
@Html.Action("Check", "Keem_Catalog", new { productId = Model.Id})
  

make sure that any views or partial views under vies folder in your plugin are embeded resources.

now for route

routes.MapRoute("Plugin.WhatEver.Check",
                "Plugins/WhatEver/Check",
                new { controller = "Keem_CatalogController", action = "Check" },
                new[] { "Keem.Plugin.WhatEver.Controllers" });


by the way if you want to call view in another view (both in your plugin) use this,
@Html.Partial("Keem.Plugin.WhatEver.Views.Catalog._ProductVariantAddToCart_Keem", Model.AddToCart,dataDictPrice)

    
hope this help.
12 anni tempo fa
thanks man, will try it
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.