小编Tar*_*ati的帖子

使用Telerik Kendo Grid Read方法([DataSourceRequest])的ASP.NET Core 2.0不会在发布中调用

我用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)

c# asp.net-mvc telerik kendo-grid asp.net-core-2.0

11
推荐指数
1
解决办法
737
查看次数

ASP.Net MVC多个列表从Controller返回

我正在使用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)

c# asp.net-mvc return list

2
推荐指数
1
解决办法
667
查看次数

标签 统计

asp.net-mvc ×2

c# ×2

asp.net-core-2.0 ×1

kendo-grid ×1

list ×1

return ×1

telerik ×1