We often come up with a requirement that the specific page require banner images, for example the default landing home pages. The most common requirement is that of carousel on the home page.
The general approach is to create page layouts for different design patterns. Below I am mentioning another approach to implement it.
- Add an empty contentplaceholder in the master page.
In master page we set an ID in the contentplaceholder tag. This ID will be mentioned in the page layout where we insert content tag. This will insert an empty div into the html page that will be generated.
If you wish to add banner images or carousel we will add the following code in page layout, eliminating the need for another page layout specifically only for banner images or carousel images.
- Add content tag in the page layout with the html markup.
Next when we visit the page with above mentioned code present in master pages and page layout respectively. The page will display “Sample text”.