Search code examples
asp.netmaster-pages

ASP.NET: Is there an easy way to include one instance of a div in several master pages?


I have 3 master pages, one for the home page, one for a two column layout and one for a three column layout.

They are all working fine, but there are a number of divs that are shared across the two of, or all of the pages. A couple of them are quite complex so ideally I'd just like to be able to have them coded once, and then shared across the master pages.

Is there a simple way to do this?

Many thanks in advance, Ross


Solution

  • I found this method of including the same code snippets in my multiple master pages:

        <!-- #include virtual = "/shared/divCookies.inc" -->