开发者

page method on several pages

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜