title: DetailsView update - not returning new values
body: <p>After editing some fields, clicking on Update doesn't show the new values. I have tried two ways to retrieve the new values as you can see from this shortened version of the ItemUpdating event (and both return the old ones) :-</p>
  
  <pre><code> Protected Sub DetailsView1_ItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdateEventArgs) Handles DetailsView1.ItemUpdating
  
      Dim txtPassword As TextBox = CType(DetailsView1.Rows(1).Cells(1).FindControl("txtPassword"), TextBox)
      Struct_Student.password = txtPassword.Text
  
      Dim PasswordValue As String = e.NewValues("password").ToString()
      Struct_Student.password = PasswordValue         
  
  End Sub
  </code></pre>
  
  <p>Here is a shortened version of the aspx :-</p>
  
  <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="cpMainContent" Runat="Server"&gt;      
   &lt;div id="Controls"&gt;     
   &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
     &lt;ContentTemplate&gt;   
  
     &lt;asp:DetailsView ID="DetailsView1"
        runat="server"
        AutoGenerateRows="False" 
        DataKeyNames="student_id" DataSourceID="SqlDataSource1" 
        ForeColor="Blue"
        BackColor="#FFF7E6"            
        AutoPostBack="True"                        
        AutoGenerateEditButton = True
        AutoGenerateInsertButton = True
        OnModeChanging="StudentDetailView_ModeChanging"                         
        Height=163px
        Width=327px              
        style="left: 400px; top: 1px; position: absolute;"&gt;  
  
          &lt;Fields&gt;                             
  
          &lt;asp:TemplateField 
            HeaderText="Password"&gt;
          &lt;EditItemTemplate&gt;
          &lt;asp:TextBox 
            id="txtPassword"
            Text = '&lt;%# Bind ("password") %&gt;'
            runat = "server" /&gt;
          &lt;asp:RequiredFieldValidator
            ID = "reqPassword"
            ControlToValidate = "txtPassword"
            Text = "(required)"
            Display = "Dynamic"
            runat = "server" /&gt;            
          &lt;/EditItemTemplate&gt;
          &lt;ItemTemplate&gt;
            &lt;asp:Label 
              id="PasswordLabel"
              runat="server"
              Text = '&lt;%# Eval("password") %&gt;' /&gt;
          &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;       
  
           &lt;asp:BoundField
             datafield="emailaddress"
             headertext="Email address"
             SortExpression="emailaddress"
             /&gt;
  
          &lt;/Fields&gt;
      &lt;/asp:DetailsView&gt;
  
      &lt;asp:SqlDataSource 
        ID="SqlDataSource1"
        runat="server" 
        ConnectionString="&lt;%$ ConnectionStrings:FCLManager %&gt;" ProviderName="MySql.Data.MySqlClient"
        SelectCommand="Select * from tblstudentinfo WHERE centre_id = @CentreID and fullname = @FullName"            
        &lt;SelectParameters&gt;         
          &lt;asp:Parameter Name="CentreID" Type="Int16" DefaultValue="0" /&gt;
          &lt;asp:Parameter Name="FullName" Type="String" DefaultValue="0" /&gt;
        &lt;/SelectParameters&gt;
  
      &lt;/asp:SqlDataSource&gt;         
      &lt;/ContentTemplate&gt;           
  &lt;/asp:UpdatePanel&gt;              
  &lt;/div&gt;   &lt;%--Controls div--%&gt;          
  &lt;/asp:Content&gt;
  </code></pre>