I have a gridview control on my asp.net page(vb.net). I also have a “cancel” button, that when pressed, is supposed to clear the gridview of it’s current contents.
However whenever the cancel button is pressed, it just reloads the page and the gridview is still there with the same data that I wanted clear.
Based on suggestions that I found on stackoverflow, I set the datasource to nothing, but that is not working.
Here is my code for the cancel button:
Private Sub btnCancel_Click(sender As Object, e As System.EventArgs) Handles btnCancel.Click
gvQuizReport.DataSource = Nothing
gvQuizReport.DataBind()
End Sub
Any suggestions would be welcome!
Thanks
since you have shown some interest in updatepanels, here is some starter code in case you are unfamiliar:
If you already have a
scriptmanageron your page you don’t need to add another (you will get an error). if you have any problems implementing the updatepanel, feel free to post another question, there are plenty of people to help you with it