首页 新闻 会员 周边 捐助

gridview的状态保持

0
悬赏园豆:50 [已关闭问题] 关闭于 2010-05-27 17:15

 我想把gridView状态保持,所以转换了下,如下

           StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);
            HtmlTextWriter htw = new HtmlTextWriter(sw);
            gridView1.RenderControl(htw);
            ViewState["GridView"] = sw.ToString();

但是,我不知道又怎么把这个string转成GridView呢?
Control control=ParseControl(ViewState["GridView"].ToString());
  gridView1 = control as GridView;

岚的主页 | 初学一级 | 园豆:200
提问于:2010-05-27 16:44
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册