How to clear FormView data between inserts

3.8k Views Asked by At

I have a formview and I opened it in Insert mode where the fields were all blank as I expected. I then entered some data into the fields but instead of clicking insert I clicked cancel. I then entered the formView in Insert mode again and the previous data was still present.

Can someone please tell me how to set it up so it will be cleared if cancel was pressed?

1

There are 1 best solutions below

1
On BEST ANSWER

Try doing:

this.fvw.DataSource = null;
this.fvw.DataBind();

Is typically what you do, or use client-side scripting.

HTH.