Forum Moderators: open
dim EditText as Textbox
EditText = E.Item.FindControl("txtBlah")
when i enter that into my code (of which i have Option Strict turned on), i get this error:
"Option Strict On disallows implicit conversions from 'System.Web.UI.Control' to 'System.Web.UI.WebControls.Textbox'."
i am referencing values from a datagrid, and using FindControl to pull the values to then add to my datatable. do the writers of my book not use Option Strict in this example, or am i doing something wrong?
-Matt
Dim EditText as Textbox
EditText = CType(E.Item.FindControl("txtBlah"), Textbox)
Dim EditText as Textbox
EditText = DirectCast(E.Item.FindControl("txtBlah"), Textbox)
worked as you described, thank you.
now i have a new problem... when i use FindControl, it pulls the original value of the textbox, and saves THAT (as opposed to using the updated textbox value). but if i use Request.Form.Item(3).ToString, it works perfectly. any idea why FindControl isn't working?
yes, it's totally off the wall, and should not be happening this way, i know this :)
-Matt