Your markup cannot touch a protected property. I just tested this:
<cc1:ServerControl1 ID="ServerControl11" runat="server" Text="Text Set"
ProtectedText="foo" />
protected string ProtectedText { get; set; }
protected override void RenderContents(HtmlTextWriter output)
{
output.Write(Text);
output.Write(ProtectedText);
}
This does not display "foo". The property is never modified.
If you set the page to Debug="true":
<%@ Page Language="C#" ... 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:
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::ServerControl1.ServerControl1 @__BuildControlServerControl11() {
global::ServerControl1.ServerControl1 @__ctrl;
#line 15 "C:\Documents and Settings\jsaunder\My Documents\Visual Studio 2008\Projects\SOSoln\WebApplication1\Default.aspx"
@__ctrl = new global::ServerControl1.ServerControl1();
#line default
#line hidden
this.ServerControl11 = @__ctrl;
@__ctrl.ApplyStyleSheetSkin(this);
#line 15 "C:\Documents and Settings\jsaunder\My Documents\Visual Studio 2008\Projects\SOSoln\WebApplication1\Default.aspx"
@__ctrl.ID = "ServerControl11";
#line default
#line hidden
#line 15 "C:\Documents and Settings\jsaunder\My Documents\Visual Studio 2008\Projects\SOSoln\WebApplication1\Default.aspx"
@__ctrl.Text = "Text Set";
#line default
#line hidden
#line 15 "C:\Documents and Settings\jsaunder\My Documents\Visual Studio 2008\Projects\SOSoln\WebApplication1\Default.aspx"
((System.Web.UI.IAttributeAccessor)(@__ctrl)).SetAttribute("ProtectedText", "foo");
#line default
#line hidden
return @__ctrl;
}
Note what happened to my "foo".