2

剣道ウィンドウの更新オプションでモデルを渡すには?

私は部分的なビューでそのために以下のコードを使用しています:-

var proWindow = $("#productWindow").data("kendoWindow");
   proWindow.refresh({            
       url: "../../Product/UpdateProduct",
       type: "POST",
       contentType:"application/json",
       data: { prodModel: $("form").serialize()
   });

そして、以下はコントローラーのコードです:-

[HttpPost]
public ActionResult UpdateProduct(ProductMaintViewModel prodModel)
{

}

しかし、コントローラーのモデルパラメーターで null を取得しています。

jquery/javascript で kendo window refresh data オプションを使用してモデル全体を投稿する方法を意味しますか?

参考までに、私は ASP.NET MVC 4 アプリケーションに取り組んでいます。

以下は私の ProductMaintViewModel クラスです:-

public class ProductMaintViewModel
{
    [HiddenInput(DisplayValue = false)]
    public int ProductID { get; set; }
    public int? CustomerId { get; set; }
    public int? InsuranceId { get; set; }

    [Required]
    [StringLength(50)]
    [Remote("CheckProductName", "Product", ErrorMessage = "Product Name already exists.")]
    [Display(Name = "Name")]
    public string Name { get; set; }

    [StringLength(100)]
    [Display(Name = "Description")]
    public string Description { get; set; }

    public bool IsDraft { get; set; }

    [Required]
    [Display(Name = "Product Type")]
    public int? SelectedProductTypeID { get; set; }
    public IEnumerable<SelectListItem> ProductTypes { get; set; }

    public bool IsDeleted { get; set; }

    [Display(Name = "Customer Type")]
    public int? SelectedCustomerSubTypeId { get; set; }
    public IEnumerable<SelectListItem> CustomerSubTypes { get; set; }      

    public IEnumerable<SelectListItem> AvailableLabor { get; set; } 


}
4

0 に答える 0