Accessing Controls in a FormView InsertItemTemplate

wings9697

Member
Joined
Aug 27, 2007
Messages
23
Location
Washington, DC
Programming Experience
10+
Hi, I'm new to .Net and I have been racking my mind trying to figure out how to solve this problem.

I'm in the process of building a log to track events. I have five specific text boxes on this form, three to track event process times, and two to track event start and end dates, all of which are defined in the SQL table as DateTime. When I test the data entry and put something like "4:50" in the one of the time fields, it puts the full date plus the time in the SQL table field, same for the date boxes. I wrote a quickie routine to shave off what I didn't need for each field, which works, but when I try to attach it to my form view insert item template control, it won't connect to the control and get the value in the text box. But when I tested it on a page with a single text box and a button which fired the routine, it worked like a champ.

When I tried FindControl (as I was earlier referred to ) -

inText = CType(Me.FormView1.FindControl("case_dispatchedTextBox"), DateTime)

I get the blue squiggly line, telling me that "Value of Sytem.Web.UI.Control cannot be converted to Date.

Can someone help me understand how I'm supposed to address controls in a FormView Template? I'm totally stuck....
 
Back
Top