opensubscriber
   Find in this group all groups
 
Unknown more information…

d : dotnet-web@discuss.develop.com 10 May 2008 • 5:53AM -0400

Re: [DOTNET-WEB] Access UserControl
by Efran Cobisi, cobisi.com

REPLY TO AUTHOR
 
REPLY TO GROUP



>
> Could you tell me how to access the method of my UserControl ?

To access your user control methods from within its containing page
code, you should first make sure that the control itself has an ID
properly set; after that, ensure the methods or properties you'd like to
reach are public ones.
Given that, public members of your control should now be accessible
using its mapped istance variable, named after the ID you set previously.

[Page markup]
<custom:MyControl id="foo" runat="server" />

[User control code]
public void Bar() { // Method implementation }

[Page code]
foo.Bar();

HTH
--
Efran Cobisi
http://www.cobisi.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

opensubscriber is not affiliated with the authors of this message nor responsible for its content.