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)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.