Doesn’t <asp:A runat=”server” B=”someValue” … /> syntax violate one of the basic rules in C# languag
Posted
by AspOnMyNet
on Stack Overflow
See other posts from Stack Overflow
or by AspOnMyNet
Published on 2010-03-23T20:12:11Z
Indexed on
2010/03/23
20:23 UTC
Read the original article
Hit count: 123
Assuming server control of type A has a protected member M, then we are also able to access A.M via declaring control tag A on some aspx page:
<asp:A runat=”server” M=”someValue” … />
But isn’t one of the rules in C# that protected members of class A can only be accessed from A and from classes derived from A? So doesn’t the ability to access member A.M via <asp:A M=”someValue” … /> syntax violate this rule, since we are basically accessing A.M from a class ( which is automatically generated aspx class ) not derived from A?!
© Stack Overflow or respective owner