How to clear FormView data between inserts
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?
Try doing:
this.fvw.DataSource = null;
this.fvw.DataBind();
Is typically what you do, or use client-side scripting.
HTH.
精彩评论