我用Telerik Kendo UI和Asp.Net Core 2.0控件创建了一个应用程序.在本地,我们能够在Visual Studio 2017中无错误地运行相同的代码,但在本地IIS中发布后,它会给出以下错误(参见附图).
错误: - " http:// localhost:91/Masters/GetStateList 404(Not Found)".
在检查错误时发现只调用了一个网格的Read方法(可能是由于'[DataSourceRequest] DataSourceRequest'参数)(其他动作方法完全被称为如下面的代码'GetRecordStatusList()')
控制器:
public class MastersController : Controller
{
private IAllRepository<StateMaster> iAllStateRepository;
public IActionResult StateMaster()
{
List<SelectListItem> statusList = new List<SelectListItem>() {
new SelectListItem{Text = "Active", Value = "1" },
new SelectListItem{Text = "Inactive", Value = "2" }
};
HttpContext.Session.SetInt32("UserId", 1);
HttpContext.Session.SetString("UserName", "Admin");
ViewBag.UserName = HttpContext.Session.GetString("UserName");
return View();
}
//This action method is not called in published-code
public ActionResult GetStateList([DataSourceRequest]DataSourceRequest request)
{
this.iAllStateRepository = new StateMasterRepository(); …Run Code Online (Sandbox Code Playgroud) 我正在使用mvc4剃须刀,这是第一个型号代码
public class WebLicenses
{
public string WebLicenseName { get; set; }
public int CustomerWebLicensesCount { get; set; }
}
public class WebApplication
{
public string WebApplicationName { get; set; }
public int Count { get; set; }
[DisplayFormat(DataFormatString = "{0:dd.MM.yyyy}")]
public DateTime? EndDate { get; set; }
public string Never { get; set; }
}
public class griddetail
{
public griddetail( List<WebLicenses> wl1,List<WebApplication> wa1 )
{
wl =wl1;
wa = wa1;
}
//public List<WebLicenses> wl2 { get; private set; …Run Code Online (Sandbox Code Playgroud)