如何在GridView可以我清楚的数据? [英] How can I clear data in a GridView?

查看:120
本文介绍了如何在GridView可以我清楚的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个 GridView的在我的网页。

使用的SelectedIndexChanged 事件中,我把 GridView2 GridView3 GridView1 但是当我重新启动我的应用程序 GridView1 数据仍然坚持在浏览器中。

Using the SelectedIndexChanged event I put GridView2 and GridView3 data in GridView1 but when I restart my application GridView1 data is still persisted in browser.

我使用的会话变量来存储数据。如何清除 GridView1

I used a session variable to store the data. How can I clear GridView1

推荐答案

您可以尝试启动应用程序每次疏通GridView1本身:

You can try to clear the GridView1 itself every time you start the application:

protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GridView1.DataSource = null;
                GridView1.DataBind();
            }

        }

这篇关于如何在GridView可以我清楚的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆