Protected void page_load (Object sender, eventargs E)
{
Classtest cls1 = new classtest ();
Cls1.oripage = sender;
}
In this way, the oripage attribute is used for bridge.
The purpose is to assign an initial value to this page.
The reason is that there are many pages with the same style but different operations
Then we bind it as a delegate, and then use an oninit event to trigger the initialization assignment.
Of course, this delegation and initialization will be introduced in the subsequent articles.
The advantage of the Bridge Mode here is that our program is highly reusable and can be assigned values for different pages. Another factor is why we don't need to continue
Because the page permissions of different pages are already different, it is obvious that there are too many levels of permissions for the parent class.
Suitable, so it forms a typical application of the Bridge Mode. However, it must be noted that this application is very coupled, especially
The control names on the page must be exactly the same, but this project meets these conditions.
A good use of the design model is just a word, the soldiers have no fixed set, water impermanence.