代码之家  ›  专栏  ›  技术社区  ›  user6395764

Kendo UI MVC不呈现简单控件

  •  0
  • user6395764  · 技术社区  · 6 年前

    我正在使用剑道MVC UI。我放置了一个按钮进行测试。我已经安排好了一切。解决方案正在构建中,但按钮被渲染为一个简单的按钮,它没有我提到的k类和图像。

    @(Html.Kendo().Button() .Name("btn") .HtmlAttributes(new { type = "button}) .ImageUrl(Url.Content("~/Content/Images/qbo.png")) .Content("This Button"))

    上述html呈现为:

    <button class="element-center" id="btn" type="button">This Button</button>

    有什么想法吗?

    2 回复  |  直到 6 年前
        1
  •  1
  •   user6395764    6 年前

    我发现了问题。MVC包装器脚本放在剑道脚本文件之前。我推迟了脚本渲染,现在工作正常。

        2
  •  0
  •   Rod    6 年前

    在代码中,type属性后缺少一个

    type=“按钮

    无论如何,看看 examples

    @(Html.Kendo().Button()
        .Name("imageButton")
        .HtmlAttributes( new {type = "button"} )
        .ImageUrl(Url.Content("~/Content/shared/icons/sports/snowboarding.png"))
        .Content("Image icon"))