3
我想從我的數據庫值傳遞給在asp.net mvc的觀點,很簡單的東西ViewBag分配
public ActionResult SettingsList() {
using (podio_doc_db db = new podio_doc_db()) {
string app_id = db.Configs.Where(r => r.Key == "app.id").Select(r => r.Value).First();
ViewBag["app_id"] = app_id;
}
return View();
}
不過,我不斷收到此錯誤
Cannot apply indexing with [] to an expression of type 'System.Dynamic.DynamicObject'
很尷尬:) –