我意识到kendo UI Tabstrip(对于ASP.NET MVC)使用get方法进行ajax调用来加载内容。但是我的viewmodel包含一些列表,不能通过get方法发送。我怎样才能将deafult ajax调用方法从get更改为post。
@(Html.Kendo()
.TabStrip().Name("productManagementTabStrip")
.Items(items =>
{
items.Add()
.Text("Search Products")
.Encoded(false)
.LoadContentFrom("GetProductManagementSearchView", "Products", Model)
.Selected(true);}))
我的模特是:
public class ProductManagementSearchViewModel
{
public bool AutoSearch { get; set; }
public string ProductNumber { get; set; }
public string ProductDetailNumber { get; set; }
public string ProductSupplier { get; set; }
public string ProductTitleDescription { get; set; }
public int? ProductCategotyTypeId { get; set; }
public IList<int> ProductCategory { get; set; }
public IList<int> ProductStatusIds { get; set; }
public string ProductSupplierCode { get; set; }
public string ProductProgramItemCode { get; set; }
public ProductManagementSearchViewModel()
{
AutoSearch = false;
ProductStatusIds = new List<int>();
ProductCategory = new List<int>();
}
}
我检查了Fiddler发送给控制器的数据。作为查询字符串发送的所有模型属性。很明显,ajax调用方法是get。我在模型中有两个数组。 URL是这样的:/ Products/GetProductManagementSearchView?ProductCategory=System.Collections.Gene ric.List1 [System.Int32]&amp; ProductStatusIds = System.Collections.Generic.List1 [Syste m.Int32]&amp; AutoSearch = False&amp; ; _ = 1463491518221
我还将模型作为RouteValueDictionary发送,但没有任何进展,如新的RouteValueDictionary(模型)