City
選択した国にCurrency
基づいて、2 つのドロップダウンをバインドしたいと考えています。そこで、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
}