There are two ways I can think to do this.
The first way would be to use a datasource that supports an update command and using two way binding to up date the values. The following snipped uses two way binding to populate the name and student fields and it will also update them for you.
<EditItemTemplate>
<tr style="background-color: #FFCC66;color: #000080;">
<td>
<asp:Button ID="UpdateButton" runat="server" CommandName="Update"
Text="Update" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
Text="Cancel" />
</td>
<td>
<asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' />
</td>
<td>
<asp:TextBox ID="studentTextBox" runat="server" Text='<%# Bind("student") %>' />
</td>
</tr>
</EditItemTemplate>
If you are not using a datasource that supports this you can do one other thing.
Notice how the update button has a command called "Update". You can use this to fetch the control values you want by handling the list views ItemCommand Event.
protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
{
if (e.CommandName == "Update")
{
TextBox box = (TextBox)e.Item.FindControl("nameTextBox");
string name = box.Text;
}
}
You can find any control in the editied item by simply calling find control and passing it the control's ID, and don't forget the cast.
Hope this helps