Re: User control visibility
Efran Cobisi <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.web |
|---|---|
| Organization | QBGROUP SpA |
| Message-ID | <[email protected]> |
Hi Mark,
In ASP.NET version 2.0 compilation model, controls like this one are
built in the containing control type as protected members and their
visibility could not be changed.
I discourage trying to break this behavior but, if you really need to,
you can break the encapsulation of the former control and let users
access the latter using a public property like this one (C# code):
// Assuming your inner textbox is named "txtInnerTextBox"
public TextBox InnerTextBox
{
get
{
return txtInnerTextBox;
}
}
HTH
Efran Cobisi
http://www.cobisi.com
Mark Aurit wrote:
> I have a textbox control in a user control. In 1.1 I was able to access
> its .text property from the calling page by changing the protection
> level of the control in the .ascx from protected to public.
> How does one do the same thing in 2.0, since they are not able (at least
> Im not able!) to touch the protection level?
> Thanks, Mark
>
>
> ====================
> Mark Aurit
> [email protected]
>
> ===================================
> This list is hosted by DevelopMentor® http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
===================================
This list is hosted by DevelopMentor® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com