Retrieving values from DetailsView Control with template fields
Posted on 2007-11-13
I'm new to the details view control. I've created one, and and it's pulling data perfectly. I then created an "accept" button. When the user clicks it, take the first 2 fields of the DetailsView control and populate text boxes with them like this:
txtCompanyName.Text = dvCompany.Rows(0).Cells(1).Text
txtCompanyID.Text = dvCompany.Rows(1).Cells(1).Text
This was working like a charm. Them I turned those first 2 fields into Template Fields so I could validate them. Ever since then, the above lines pull a blank string. It's almost like, the above just doesn't apply to template fields. Or something. Does anyone know how I can get this working?