protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { MyGridView.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) // note the not operator (!) { MyGridView.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MyGridView.DataSource = ???; //set the data source here MyGridView.DataBind(); } }
Response.Cache.SetCacheability(HttpCacheability.NoCache) in Page_Load() fixed the refresh issue.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)