Asp net detailsview itemupdating e newvalues
Ok, Now I'm sure this was working the other day and I don't think I've changed anything but now it's not working and I can't see anything wrong with the code.
Basically I have a details view with product information in it, when the user clicks edit it goes into edit mode when I change any of the fields and click update it updates but with the old values.
I can't see anything wrong with the code and it's driving me mad. hi, i think you miss something, try to see the table where you save the value of the fields you entered if it change anything, if it change anything, then you have put some code on your SP that retrieves data after the UPDATE code that you have.
NET 4.0 (Web Forms) A snippet of code that I believe to be relevant below: The problem is that if I want to handle the old values, I can´t: this, evaluates to 0: int old Values Count = e. Count; and this, evaluates to null, even if I alter the value to a new one: string company Name Old = e.
If it's bound via Linq Data Source, Sql Data Source or Object Data Source I suggest you have a look at the Updating Event.
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.