使用ViewState时绑定到Grid时,F.state报错。
哪位有遇到这种情况?下面是报错时候的提示信息:
- var f0=F('regionAuto_region1_gdData'),f1=F('winSelect');f0.f_tpls="";F.state(f0,{"F_Rows":{"Values":[["","2912010-5小解放","#@TPL@#ctl07","前","1","一片"],["","2912010-5小解放","#@TPL@#ctl08","前","1","二片"],["","2912010-5小解放","#@TPL@#ctl09","前","1","四片"]],"DataKeys":[[2008],[2009],[2010]],"States":[[],[],[]]},"F_Rows_GZ":""});f0.f_loadData();f0.f_collapseAllRows();f0.f_selectRows();F.state(f1,{"Hidden":true});
复制代码
下面代码存放ViewState
- private void BindData()
- {
- gdData.DataSource = Products;
- gdData.DataBind();
- }
- private List<Auto_Parts> Products
- {
- get
- {
- if (ViewState["Products"] == null)
- {
- ViewState["Products"] = new List<Auto_Parts>();
- }
- return (List<Auto_Parts>)ViewState["Products"];
- }
- set
- {
- ViewState["Products"] = value;
- }
- }
- public class Auto_Parts
- {
- public int ID { get; set; }
- public string FullName { get; set; }
- public string Type { get; set; }
- public string Position { get; set; }
- public int Quantity { get; set; }
- public string Standard { get; set; }
- public string Name { get; set; }
- public decimal Price { get; set; }
- public string Pinyin { get; set; }
- public string Wubi { get; set; }
- public int HasCard { get; set; }
- public int IsDualSlot { get; set; }
- public string Remark { get; set; }
- public decimal Total { get; set; }
- }
复制代码
|