发布的CheckedNodes始终为null

时间:2013-01-10 08:21:25

标签: kendo-ui

我已经按照教程和kendo树视图的文档进行了操作,但我有一个实例,我在其中添加了隐藏值到复选框模板中。问题是当单击提交按钮时,发布的值始终为空。

这是我的观点

 @using (Ajax.BeginForm("Projects", "Maintenance", FormMethod.Post,null))
{
<div class="treeview-back">

    @Html.TextBoxFor(c => c.UserAccountID)

    @(Html.Kendo().TreeView()
                .Name("treeviewSiteList")
                .DataTextField("Name")
                .Checkboxes(checkboxes => checkboxes                        
                    .CheckChildren(true)                                                                                          
                    .TemplateId("treeview-checkbox-template")                        
                )                    
                .DataSource(dataSource => dataSource                        
                .Read(read => read
                        .Action("UserProjectFolderList", "Maintenance", new { useraccount_id = Model.UserAccountID }))
                )
    )

</div>

<button type="submit" class="k-button">Save</button>
}

<script id="treeview-checkbox-template" type="text/kendo-ui-template">
       <input type="checkbox" name="treeviewNodes[#= item.id#]" value="#= item.id # "/>                                          
       <input type="hidden" name="treeviewNodes[#= item.id #]" value="#= item.SiteID #"/>
</script>

以下是我的观点:

public ActionResult GetChecked(int[] treeViewNodes)
{
}

0 个答案:

没有答案
相关问题