Your User Control is (probably) going to be a member of the WebForm's
Controls Collection, and you can use the FindControl() method to locate it
and call any Methods you want. Example:
Page.FindControl("Form1").FindControl("MyUserContr olID").MySub()
The FindControl() method of a Server Control will look in the immediate
children of the Control, and return a reference to the Control found. That
is why I used the FindControl() method on the Page to get the Form, and the
FindControl() Method of the Form to find the UserControl. If the User
Control were inside another Control, you would look in that Contro's
Controls Collection for it.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Max" <ma*****@portvista.com> wrote in message
news:cF*****************@twister.tampabay.rr.com.. .
How do I declare in the parent page's code behind a user control? I want
to call a sub that is located in the user control.
Want to do something like this:
Call MyUserControl.MySub()