accessing usercontrol from another usercontrol

  • Thread starter Thread starter Phl
  • Start date Start date
P

Phl

Hi,

I have a page with many usercontols and I would like to access other
usercontrols from one usercotnrol , so I can access their server
controls. This is how I do it,

EditProfile UserControlep =
(EditProfile)Page.FindControl("EditProfile");

This works when I debug it in my localmachine but doesn't when I have
my page running on my production server. Does anyone know why is this
because the usercontrols ID can get changed by .net? If so, I can't
see the id of of usercontrol in the rendered page anyway, so how can I
access it?

Cheers
 
You can treat usercontrols just like you would treat a class. You must
declare public methods or properties in code that you want to be exposed to
other classes in the usercontrol. By default everything is hidden
 
Back
Top