An Application of the Bridge Mode in Asp.net

Source: Internet
Author: User
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.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.