Change Control Access Modifers in ASP.NET 2.0

G

Guest

How can i change the access modifier of a control from protected to public if
the designer code is not visible to the developer? I tryed declaring it on
the page but it throws a compile error saying that the control has already
been declared as protected.

Nuno
 
S

S. Justin Gengo [MCP]

Nuno,

How about accessing it via a Public Property?

Public Property MyControl As Button
Get
Return Button1
End Get
Set (ByVal value As Button)
Button1 = value
End Set
End Property

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
G

Guest

Unfortunately, that is how I've been doing it. I really liked how we had the
ability to modify the access modifiers of our web controls directly instead
of having to create a property just to make a control public. However, I do
like the automated connection between the aspx controls and codebehind
control.

Nuno Pereira
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top