public class PaymentMethod : BasePlugin, IAdminMenuPlugin
{
public void ManageSiteMap(SiteMapNode rootNode)
{
var pluginMainMenu = new SiteMapNode()
{
Title = "PB",
Url = "~/Plugins/PaymentCredit/Index",
Visible = true,
SystemName = "Admin.GroupBuyingHub",
IconClass = "fa-genderless"
};
rootNode.ChildNodes.Add(pluginMainMenu);
}
}
I also created the RouteProvider.cs:
public partial class RouteProvider : IRouteProvider
{
public void RegisterRoutes(IRouteBuilder routeBuilder)
{
routeBuilder.MapRoute("PaymentCreditAdmin","Plugins/PaymentCredit/Index",new {controller="PaymentCredit", action="Index"});
}
public int Priority
{
get { return 99; }
}
}
This is my Controller:
class PaymentCreditController : BaseAdminController
{
public ActionResult Index()
{
return View("~/Plugins/Payments.CreditCard/Views/Index.cshtml");
}
}
And I create a simplest view "Index.cshtml" in Views folder as follow:
<!DOCTYPE html>
<html>
<head>
<title>View</title>
</head>
<body>
<div>
</div>
</body>
</html>
when I run it and click the item, the Url address goes to "http://localhost:15536/Plugins/PaymentCredit/Index". However, it shows "Page not found" page. Is there anything wrong?
Thanks for any help.