event is raised when an Update button within a Details View control is clicked, but before the update operation.This allows you to provide an event handler that performs a custom routine, such as canceling the update operation, whenever this event occurs.Refer here: View (and Grid View) don't work properly when not used with a proper datasource. :) you did but what I meant was that you were using this: //Even this Find Control does not help either to read the newly entered Text // Text Box test = (Text Box) dv User Record. Most notibly, the values dictionaries in the events for updating are not filled. Find Control("address"); whereas, and I think, your detailsview is named dv Record. Instead when setting the Update Parameters in the codebehind, the control will update the database with the parameter names entered.For example ‘@Parameter’, will be sent in the update to the record instead of null.When all you've got is a Hammer, Every Problem looks like a Nail. Details View (and Grid View) don't work properly when not used with a proper datasource. New Values is used it is returning null and dv User. also, this is what superguppie is suggesting too (out of two options for you) Looking up the Controls should work. Page protected void Page_Load(object sender, Event Args e) protected void Radio Button List1_Selected Index Changed(object sender, Event Args e) protected void Details View1_Item Updating(object sender, Details View Update Event Args e) protected void Edit Button_Click(object sender, Event Args e) protected void Update Button_Click(object sender, Event Args e) protected void Cancel Button_Click(object sender, Event Args e) The Item class is as before.
I have some controls that I dynamically show/hide in the Gridview and I have hit a wall replicating the behavior in the Details View.To solve this, you would need to automatically detect whether a value is null and then add it to the Update Parameters list.When the update button is pressed it takes to Grid View_Item Updating event as shown below code. This will be solved when calling the Item Updating event.After setting the Details View’s Item Updating method, you will need to modify the SQL Data Source’s Update Command, Update Command Type, and Update Parameters.