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?!
Your markup cannot touch a protected property. I just tested this:
This does not display “foo”. The property is never modified.
If you set the page to Debug=”true”:
then the C# files that ASP.NET turns your markup into will be left on disk under C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files. It will take some hunting to find the right directory, but here’s what I saw for that markup:
Note what happened to my “foo”.