I am working on a plugin that would allow our Nop 4.0 site to pull information from our internal systems. I have a widget that I am attempting to open a page with, and I keep getting page not found. I would appreciate any comments.
Here is plugin logic that shows the button on page.
@model Nop.Plugin.AMT.Lion.Models.PublicInfoModel
@{
Layout = "";
}
<div>
<a href="AMTController/Backorder">
<input type="button" value="Backorder" />
</a>
<a asp-controller="AMTController" asp-action="Backorder">Click Me</a>
<a asp-controller="AMTController" >Index</a>
</div>
Here is BackorderModel.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Nop.Web.Framework.Mvc.Models;
namespace Nop.Plugin.AMT.Lion.Models
{
public class BackorderModel : BaseNopModel
{
}
}
Here is Backorder view.
@model Nop.Plugin.AMT.Lion.Models.BackorderModel
@inherits Nop.Web.Framework.Mvc.Razor.NopRazorPage<TModel>
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Nop.Web.Framework
@using Microsoft.AspNetCore.Mvc.ViewFeatures
@using Nop.Web.Framework.UI
@using Nop.Web.Framework.Extensions
@using System.Text.Encodings.Web
@{
Layout = "_ColumnsOne.cshtml";
}
<table class="bkor-table" cellspacing="2" cellpadding="1" border="0">
<thead>table header row</thead>
</table>
Here is Backorder controller.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Nop.Core;
using Nop.Core.Caching;
using Nop.Plugin.AMT.Lion.Models;
using Nop.Services.Configuration;
using Nop.Services.Localization;
using Nop.Services.Media;
using Nop.Services.Security;
using Nop.Services.Stores;
using Nop.Web.Framework;
using Nop.Web.Framework.Controllers;
using Nop.Web.Framework.Mvc.Filters;
namespace Nop.Plugin.AMT.Lion.Controllers
{
public class AMTController : Controller
{
public ActionResult Backorder()
{
return View("~/Plugins/Widgets.AmtLion/Views/Backorder.cshtml");
}
}
}
And I added a route -
// AMT BKOR page
routeBuilder.MapLocalizedRoute("AMTController", "Backorder",
new { controller = "AMTController", action = "Backorder" });
When I click the button, the url shows as - http://testserv2.mebulbs.com/AMTController/Backorder
Why is the blank page not showing?