J
jm
Dim order_type As DropDownList = _
(CType(e.Item.FindControl("order_type"), DropDownList))
This control is in a datalist itemtemplate. It will not find it.
Whenever I try and do anything further with this, it says:
Object reference not set to an instance of an object.
My guess is that that means it cannot find the control on the form.
Thank you for help.
If I change it to this:
Dim test As dropdownlist
test = CType(e.Item.FindControl("order_type"), dropdownlist)
I get no errors. But when I do this:
response.write(test.ID)
I get:
Object reference not set to an instance of an object.
Any ideas?
Finally,
e As DataListItemEventArgs)
Dim test As new dropdownlist
test = e.Item.FindControl("order_type")
response.write(test.ID)
I read the error a little close and put the new, but it still won't
find the control.
Thanks for any help.
It's in the OnItemDataBound event, so I don't know why it cannot find
the object (in a datalist control). I have tried everything I know.
Thank you for any help.
(CType(e.Item.FindControl("order_type"), DropDownList))
This control is in a datalist itemtemplate. It will not find it.
Whenever I try and do anything further with this, it says:
Object reference not set to an instance of an object.
My guess is that that means it cannot find the control on the form.
Thank you for help.
If I change it to this:
Dim test As dropdownlist
test = CType(e.Item.FindControl("order_type"), dropdownlist)
I get no errors. But when I do this:
response.write(test.ID)
I get:
Object reference not set to an instance of an object.
Any ideas?
Finally,
e As DataListItemEventArgs)
Dim test As new dropdownlist
test = e.Item.FindControl("order_type")
response.write(test.ID)
I read the error a little close and put the new, but it still won't
find the control.
Thanks for any help.
It's in the OnItemDataBound event, so I don't know why it cannot find
the object (in a datalist control). I have tried everything I know.
Thank you for any help.