我使用以下代码制作 JSON
FilterModel f = new FilterModel();
f.FilterName = "EducationLevel";
f.filterValue = new List<string>();
f.filterValue.Add("BE");
f.GroupName="Education";
FilterDictionary d = new FilterDictionary();
d.FilterValuse = new Dictionary<string, List<string>>();
d.FilterValuse.Add(f.FilterName, f.filterValue);
FilterSelectModel ff = new FilterSelectModel();
ff.Filters = new Dictionary<string, Dictionary<string, List<string>>>();
ff.Filters[f.GroupName].Add(f.FilterName, f.filterValue);
var json = new JavaScriptSerializer().Serialize(ff);
Response.Write(json);
但它在下面的行中显示了一个异常
ff.Filters[f.GroupName].Add(f.FilterName, f.filterValue);
它显示以下错误
字典中不存在给定的键
什么地方出了错 ?任何人都可以帮助我