why why why usercontrol

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??
 
L

Laurent Bugnion

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
 
S

Steve B.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top