How to bind grid view only button clicked
i want to display grid view only when button is clicked,if i refresh the page should not display the grid view display only button...how to do this?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Ramesh PalanivelRank #372 · 6.8K reputationPosted Mar 13, 2017, 1:47 AM EDT
Mohan Srinivas129 reputationPosted Mar 13, 2017, 1:49 AM EDT
Ramesh PalanivelRank #372 · 6.8K reputationPosted Mar 13, 2017, 2:15 AM EDT
Button_Click(object sender, EventArgs e) { con.open(); sqlconnection con=new sqlconnection("your connection string"); dataset ds=new dataset(); sqldataadapter sdr=new sqldataadapter("select * from tablename",con); sdr.Fill(ds); gridview1.datasource=ds.tables[0]; con.close(); } // Page On Load page_onload() { gridview1.datasource=null; }