我想根据所选国家绑定 2City
个下拉列表。Currency
所以我使用Json并通过选择的countryId并在控制器中写入以获取相应的货币和城市值。但问题是,如何将 json 中的 2 个值作为返回类型传递?
这是代码:
[HttpPost]
public ActionResult BindCityAndCurrency(int CountryID)
{
var q = from r in db.Cities where r.CountryID == CountryID orderby r.CityID, r.CityName select r;
var City = q.ToList().Select(c => new { Text = c.CityName, Value = c.CityID });
var Currency = from items in db.Currencies where items.CountryID == CountryID orderby items.CurrencyName, items.CurrencyName select items;
return Json(City,Currency);//here is the error showing Invalid Arguments I
}