开发者

page method on several pages

开发者 https://www.devze.com 2023-02-17 05:03 出处:网络
What\'s the best way to make several page methods available on multiple pages. All the pages that will contain these page methods belong to the开发者_C百科 same master page. Do I put them in the maste

What's the best way to make several page methods available on multiple pages. All the pages that will contain these page methods belong to the开发者_C百科 same master page. Do I put them in the master page or do I create a base page?

Thanks.


A slightly more in-depth description of what the methods do might help, but depending on their purpose you have two options:

  1. Create a base page class and allow the pages to inherit from that class (better option to use if the methods modify the page's internal state).

  2. Create a library of static helper methods (better option if the methods are utility methods that don't modify the internal state of the page).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号