我要显示浮动值,但我不能。我已经尝试过JSON.stringify()但它不会工作。请帮帮我。
$.ajax({
url: "/Home/GetItemsByFilter",
method: "POST",
data: {
CategoryId: '',
SubCategoryId: '',
SubSubCategoryId: $("#sub_sub_category_id").val(),
MinPrice: $("#min_price").val(),
MaxPrice: $("#max_price").val(),
BrandId: $("#brand").val(),
OrderBy: $("#price_direction").val(),
PageNumber: currentPage,
PageSize: 18
},
error: function (response) {
alert("There is something wrong!!!");
},
来自控制器:
ViewBag.MinPrice = Convert.ToDouble( ItemList.Min(m => m.PriceAfterDiscount));
ViewBag.MaxPrice = Convert.ToDouble(ItemList.Max(m => m.PriceAfterDiscount));
GetItemsByFilter:
double MinPrice = Convert.ToDouble(Request["MinPrice"]);
double MaxPrice = Convert.ToDouble(Request["MaxPrice"]);
double ActualMaxPrice = Convert.ToDouble(Request["ActualMaxPrice"]);
string SubSubCategoryId = Request["SubSubCategoryId"];
string CategoryId = Request["CategoryId"];
string SubCategoryId = Request["SubCategoryId"];
string BrandId = Request["BrandId"];
string OrderByS = Request["OrderBy"];