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.
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.
The Details View control lacks a property to indicate the default value of an input field. You might think that the Details View control fires an event that, properly handled, gives you a chance to set the default value of input fields. More precisely, the Details View control doesn t fire a specific event that would let you do so.
However, in the long list of events fired by the Details View control, there s one that you can leverage to implement a little piece of logic to set default input values.
You can choose the most appropriate combination of data fields to render each piece of information conveniently.
The default set of data fields includes templated, image checkboxes, and hyperlink fields.
After doing this, we can retrieve the Data Key value in the following ways. So, we call Databind() method in the Page Index Changed event handler and then retrieve the datakey value as shown in the code given below.
The code to retrieve Data Key value in the Data Bound event of details View control is given below.
In this column, I ll first answer a specific question posed by a reader, then move on to putting the solution in perspective and extending other features of the Details View control.Filling out the form and inserting a record into the database works well.