That is to follow good practical of programming POO. Thus you earn in maintenance of its objects.You create the public methods (properties) to keep the abstraction of the class, in case that you it makes some alteration in the controls of user control, with this the alterations do not spread for other class that are using this usercontrol.
[]'s F�bio 2005/4/27, Yannick Smits <[EMAIL PROTECTED]>: > > Thanks F�bio. Is this to prevent visual studio from resetting them to > protected everytime you use the designer or to follow good programming > practices? I hate making properties because it is time consuming. > > Yannick > ----- Original Message ----- > From: "F�bio Rosato" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Tuesday, April 26, 2005 1:52 PM > Subject: Re: [AspNetAnyQuestionIsOk] Findcontrol or public accessors > > Hi Yannick, > > In class of the usercontrol create a property (public method) > accessing a property "Text" of the textbox. > > []'s > F�bio Rosato > > 2005/4/25, Yannick Smits <[EMAIL PROTECTED]>: > > > > From the page code I want to access a textbox value of a user contorl on > > that page. what is the recommended approach: > > - ((TextBox)Usercontrol1.FindControl("textbox1")).Text or > > - make textbox1 public in user control and access using > > Usercontrol1.textbox1.Text? > > > > Thanks, > > Yannick Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
