I have some code for my FormView that fires on the DataBound event. Unfortunately (for what I’m doing, anyway) it fires the same whether it’s first rendering the page or if I just clicked Edit. I need it to do a few things differently if it’s being run on the ItemTemplate verses the EditItemTemplate. My searches on the subject have thus far been fruitless. Is there a simple way to do something along the lines of if(IsEditItemTemplate) ?
I have some code for my FormView that fires on the DataBound event. Unfortunately
Share
FormView.CurrentModeis your friendMore explanation here
From the quoted site:
Mode Description FormViewMode.Edit The FormView control is in edit mode, which allows the user to update the values of a record. FormViewMode.Insert The FormView control is in insert mode, which allows the user to add a new record to the data source. FormViewMode.ReadOnly The FormView control is in read-only mode, which is the normal display mode.Sample Code