You can access the original data. After I access it, I find that I have operated on private fields.
Reference Code
Public class L3Data: System. ComponentModel. Component
{
Private System. ComponentModel. Container components = null;
Private Page _ page;
Private ArrayList LiteralList = new ArrayList ();
Public L3Data (System. ComponentModel. IContainer container)
{
Container. Add (this );
InitializeComponent ();
}
Public L3Data ()
{
InitializeComponent ();
}
Protected override void Dispose (bool disposing)
{
If (disposing)
{
If (components! = Null)
{
Components. Dispose ();
}
}
Base. Dispose (disposing );
}
# Code generated by the region component designer
Private void InitializeComponent ()
{
Components = new System. ComponentModel. Container ();
}
# Endregion
# Region Property
Public Page
{
Get {return this. _ page ;}
Set
{
This. _ page = value;
Type type = _ page. GetType ();
Type = type. BaseType;
System. Web. UI. WebControls. Literal literal = new Literal ();
System. Reflection. FieldInfo [] fields = type. GetFields (BindingFlags. NonPublic | (BindingFlags. Static | BindingFlags. Instance ));
Foreach (System. Reflection. FieldInfo field in fields)
{
If (field. FieldType. Equals (literal. GetType ()))
This. LiteralList. Add (field );
}
Int count = 0;
Foreach (FieldInfo field in this. LiteralList)
{
Count ++;
Object obj = field. GetValue (this. Page );
Literal = (Literal) obj;
If (literal. Text. Equals ("wx "))
Literal. Text = "I can see you ";
Else
{
Literal. Text = "wangxing" + count. ToString ();
}
}
}
}
# Endregion
}.