Kendo UI局部视图未渲染MVC 6

时间:2018-11-15 22:06:43

标签: kendo-ui partial-views asp.net-mvc-partialview

我有一个Kendo UI标签栏,应该在每个标签上呈现部分视图。但是它从不呈现局部视图,而是发布一个ASPNetCore类。见下文:

Error Message

这是我的“创建”页面:

        case 'lackeyml':
        break

        case 'application':
        break

        case 'thread':
        break

以下是控制器的相关部分:

@model MyApp.Models.FamilyIntake

@{
    ViewData["Title"] = "Create";
}

<div class="row">
    <div class="col-md-12">
        @using (Html.BeginForm("Create", "FamilyIntakes", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
        {

        @Html.AntiForgeryToken()

        @(Html.Kendo().TabStrip()
            .Name("tabstrip")
            .Items(tabstrip =>
        {
            tabstrip.Add().Text("Family Info")
                .Selected(true) // select the first tab
                                // Set the tab content to a partial view using a strongly typed model
                .Content(m => Html.Partial("_FamilyIntakeStep1", m));
            //clipped 5 more tabs for space

        }).Events(ev =>
        {
            ev.Select("onSelect");
            ev.Show("onShow");
        })

    )
    }
</div>
</div>

@section Scripts { .... } 

为完整起见,这里是称为_FamilyIntakesStep1的整个局部视图

// GET: FamilyIntakes/Create
    [HttpGet]
    public IActionResult Create()
    {

        //A long series of view data statements for drop downs.  Left one in for ref.
ViewData["AddressId"] = new SelectList(_context.Address, "AddressId", "AddressId");
//.......snipped viewdata........

        return View();
    }

    // POST: FamilyIntakes/Create
    [HttpPost]
    [ValidateAntiForgeryToken]
    public async Task<IActionResult> Create([Bind(@/Bound Column List Snipped /@ )] FamilyIntake familyIntake)
    {


        if (ModelState.IsValid)
        {
            _context.Add(familyIntake);
            await _context.SaveChangesAsync();
            return RedirectToAction(nameof(Index));
        }

        //A long series of view data statements for drop downs.  Left one in for ref.
ViewData["AddressId"] = new SelectList(_context.Address, "AddressId", "AddressId");
//.......snipped viewdata........

return View(familyIntake);
    }

关于我在做什么错的任何想法。我已经审查了几个类似的答案,但没有一个非常合适,也没有建议的解决方案来解决它。

我认为这可能与以下事实有关:这最初是MVC 5(ASP.Net)代码,而我正在使用MVC 6(ASP.NET Core)代码。在这种情况下,我的问题可能是如何在ASP Core中呈现部分类?

请帮助

0 个答案:

没有答案