Detailsview itemupdating e newvalues

Namely, each field in the Grid View or Details View is rendered in its editing interface; Bound Fields display a Text Box control while Check Box Fields display an enabled checkbox.Moreover, a Command Field is added, which displays the Edit, Update, and Cancel buttons, as needed.There you have access to the object via the Event Args. New Object or something like that You can cast this property into the corresponding type and make your changes.I know this is an old question but maybe this will help others that come across this problem like I did. The product table is not updating with the new values.I think the problem is to do with the new values from the textbox not being retrieved.

detailsview itemupdating e newvalues-58detailsview itemupdating e newvalues-71detailsview itemupdating e newvalues-50

If this is not the case, please first read Accessing and Updating Data in ASP.As when I assign updated Name to Label1 it displays the old product name value and not the one in the textbox.But I can't see why it wouldn't be bringing back the new textbox values.To clarify this take a look into what's happen on the Item Updating event, if we checked the e. Keys collection before we set the Name filed as read-only filed we will find that this collection contains two Items: The Details View will not pass the read-only fields to the underlying data source and this is not an issue Details View designed like this.Take a look to Handle Update method in the Details View control using reflector and you will find it does not include Read-only fields when extracting values from fields.Here is my detailsview: I tried adding a label to my page and then once updated Name had been assigned the value of the textbox I tried assigning that value to the label and it printed out the old product name not the one in the textbox.

You must have an account to comment. Please register or login here!