How to dynamically load usercontrol on the page?
1. Use Using to introduce the namespace of usercontrol.
2. Add a placeholer to the place where usercontrol is to be placed for placeholder.
3.Code
Basesubjectmodule mdlbasesubject = (basesubjectmodule) loadcontrol (@ "module \ basesubjectmodule. ascx"; // Load
Mdlbasesubject. bindtype (); // Method for executing this usercontrol
Ph. Controls. Clear (); // clear the container
Ph. Controls. Add (mdlbaseinfo); add to container
4. Description
Basesubjectmodule: Class Name of usercontrol;
PH: placeholder instance
Basic object-oriented concepts
I am reading a book titled large-scale software architecture technology. After reading this chapter, I felt good. I clarified some conceptual issues and made a summary:
1. the way people naturally think about problems is the basic principle of object-oriented;
2. Object and message transmission are the descriptive paradigm of the interaction between things and things;
3. Class and inheritance are the descriptive paradigm of people's general way of thinking;
4. Class describes the features of all objects of this type;
5. A message is the link between objects. The method is to implement the message function. messages of the same type are processed in the same way;
6. Object-oriented features encapsulation, inheritance, and polymorphism;
7. polymorphism implementation methods include overload, dynamic binding, and category (this is not clear ).
How to call the method in the current object using reflection?
Private void responseitempush (eventargs E)
{
Maid Ie = (maid) E;
Type type = typeof (subjectscheme );
Type. invokemember (ie. commandname, bindingflags. instance | bindingflags. nonpublic | bindingflags. invokemethod, null, this, new object [] {ie });
}