Kendo UI Window.refresh({ data }) 未正确传递给 ASP.Net MVC 操作

Kendo UI Window.refresh({ data }) not being passed to ASP.Net MVC action properly

我有一个 window:

@(Html.Kendo().Window()
   .Name("wndInvoiceLineEditor")
   .Title("Invoice Line Item Editor")
   .Content("loading dialog...")
   .Height(350)
   .Width(785)
   .LoadContentFrom("InvoiceLineItemEditor", "Invoice", new { LineItemId = "Initial" })
   .Draggable()
   .Resizable()
   .Visible(false)
)

我需要能够重新加载部分视图,并在运行时传递不同的数据。据我在文档中阅读,我应该能够做到这一点:

$("#wndInvoiceLineEditor").data("kendoWindow").refresh({
   data: {
      LineItemId: $($(".k-state-selected td")[0]).text()
   }
});

但是服务器端的操作:

public ActionResult InvoiceLineItemEditor(string LineItemId)
{
   int id = 0;
   if(string.IsNullOrEmpty(LineItemId) || !int.TryParse(LineItemId, out id))
   { 
      return PartialView("InvoiceLineItemEditorPartial", new InvoiceLineItem());
   }

   ...blah blah blah

...没有收到正确的 ID(jquery 从 table 获取它确实有效,已通过 Chrome 控制台测试)

相反,它接收视图中配置的数据:"Initial"。

我错过了什么吗?如何将数据发送回操作,以便我可以使用正确的信息加载该部分?

已回答:

问题是在视图 window 初始化的 LoadContentFrom 部分设置了默认数据。将其更改为:

@(Html.Kendo().Window()
   .Name("wndInvoiceLineEditor")
   .Title("Invoice Line Item Editor")
   .Content("loading dialog...")
   .Height(350)
   .Width(785)
   .LoadContentFrom("InvoiceLineItemEditor", "Invoice")
   .Draggable()
   .Resizable()
   .Visible(false)
)

...解决了问题。 window 被设置为该默认值,看似不可动摇。

问题是在视图 window 初始化的 LoadContentFrom 部分设置了默认数据。将其更改为:

@(Html.Kendo().Window()
   .Name("wndInvoiceLineEditor")
   .Title("Invoice Line Item Editor")
   .Content("loading dialog...")
   .Height(350)
   .Width(785)
   .LoadContentFrom("InvoiceLineItemEditor", "Invoice")
   .Draggable()
   .Resizable()
   .Visible(false)
)

...解决了问题。 window 被设置为该默认值,看似不可动摇。