我存储的List<KeyValuePair<string, bool>>
在ViewState中,当我试图将它转换回List<KeyValuePair<string, bool>>
错误状态无法从视图状态施放对象集合
无法转换对象出现问题的集合类型'System.Collections.Generic.Dictionary
2[System.String,System.Boolean]' to type 'System.Collections.Generic.List
1 [System.Collections.Generic.KeyValuePair`2 [System.String,System.Boolean]]'。
那么如何将我的键值列表从ViewState转回?
我的代码行是:
List<KeyValuePair<string, bool>> myObject = (List<KeyValuePair<string, bool>>)ViewState["listOutputWords"];
请粘贴代码,你试过什么?? – 2014-11-22 06:48:20
List> myObject =(List >)ViewState [“listOutputWords”]; –
2014-11-22 06:51:20
你在'ViewState [“listOutputWords”]'中放入了什么?还显示完整的例外数据。 – 2014-11-22 06:53:10