A Base page in ASP.NET

后端 未结 5 1086
一向
一向 2021-02-08 06:04

Do you recommend from every web site created in Visual Studio, that you should create a Base page that serves as the parent class?

What are the exact benefits/drawbacks?

5条回答
  •  爱一瞬间的悲伤
    2021-02-08 06:31

    Check out masterpages this is their primary purpose.

    Here's a link: http://msdn.microsoft.com/en-us/library/wtxbf3hh.aspx

    This will serve as the template for your site. You would add a content section that would make up the body of your site. You can reference the master page is your subpages to have a consistent layout, menu, etc. for you site.

    Also, like the others have noted. If you are running any commond code, just create a class a reference it from wherever you need it.

提交回复
热议问题