Kendo UI Window + PartialView

时间:2014-04-22 00:17:09

标签: asp.net-mvc-4 kendo-ui

我的视图中有此代码

@model IEnumerable<mvcAmerica.Models.Art> 
@(Html.Kendo().Window()
              .Name("window")
              .Title("Agregar Detalle")
              .Draggable()
              .Visible(false)
              .Actions(actions => actions.Close())
              .Events(ev => ev.Close("onClose"))
              .Width(600)
              .Height(600)
              .Content(() =>
                  {
                      @Html.RenderPartial("_ArtViewCreate");
                  })


)
<span id="undo" class="k-button">Click here to open the window.</span>

<script>
    function onClose() {
        $("#undo").show();
    }

    $(document).ready(function() {
        $("#undo").bind("click", function() {
                $("#window").data("kendoWindow").open();
                $("#undo").hide();
            });
    });
</script>

但结果是意外的,部分视图在我的主页面中呈现,而不是在Kendo UI Window中呈现

Main Page Not Kendo UI Window

有人帮助我吗?

谢谢

2 个答案:

答案 0 :(得分:5)

我没有使用内容而是我刚刚这样做了。 .Visible(false)就像你一样,然后在一些事件中触发这个功能。

function clientLaunchWindow() {

     var window = $("#Name").data("kendoWindow");

     window.refresh({
             url: "/Order/LaunchManualProposalWindow"        
     });      
     window.center();
     window.open();

 };

  public ActionResult LaunchManualProposalWindow()
    {           
        return PartialView("_CreateManualProposal");
    }

答案 1 :(得分:0)

您可以使用LoadContentFrom并指定Action和Controller。该操作将附加自己的部分视图。有关详细信息,请参阅here

相关问题