开发者

Using include files in asp.net

开发者 https://www.devze.com 2023-01-04 06:14 出处:网络
How can I used inclu开发者_StackOverflow社区de files (as used in classic asp) in asp.net 3.5 framework?You should use User Controls instead.

How can I used inclu开发者_StackOverflow社区de files (as used in classic asp) in asp.net 3.5 framework?


You should use User Controls instead.

To share server-side code between pages, you should add C# classes to the App_Code folder.


These were used in classic ASP to simulate a lack of any inheritance model, or composability. In ASP.Net you can use inheritance to create common functionality. Master Pages for common layout, and user controls for composability.

Inheritance will work in all three of these situations as well.

MyPage: BasePage

MyControl: BaseControl

MyMasterPage: BaseMasterPage

You have a lot of options with ASP.Net because it is built on top of an Object Oriented framework.

0

精彩评论

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