why why why usercontrol

  • Thread starter Thread starter Mr. SweatyFinger
  • Start date Start date
M

Mr. SweatyFinger

I have a usercontrol.
In the usercontrol i have a formview.
in the formview I have a dropdownlist with a sqldatasource

why why why why can't i referenct the sqldatasource from the codebehind?"

what gives??
 
Hi,

Mr. SweatyFinger said:
I have a usercontrol.
In the usercontrol i have a formview.
in the formview I have a dropdownlist with a sqldatasource

why why why why can't i referenct the sqldatasource from the codebehind?"

what gives??

why why why don't you show us your code?

:-)
HTH,
Laurent
 
Because because because because the formview is a control. You cannot
reference nested templated controls from the page that hosts the formview.
If you need to access your control within the formview, try something like
this :

DropDownListBox ddl = (DropDownListBox)FormView1.FindControl("ddl");

FindControl method will look into the nested controls (not recursively, be
carefull) of the formview and return the control it founds or null if not
found.

Steve
 
Back
Top