Search

Saturday, October 19, 2013
0 comments

What is the need of Master Pages and Themes in ASP.NET

9:05 AMSaturday, October 19, 2013

Introduction

A consistent look and feel is more of a necessity than a luxury for real-world Web applications. However, ensuring a consistent look and feel for the pages in Web Applications has not always been easy. In ASP.NET, developers can incorporate consistent look and feel in their applications by using features such as master pages and themes.
The concept of a master page is all about incorporating visual inheritance in Web application. In other words, you define the layout of a web page once, and all the pages of Web applications inherits that layout. When you create a master page, what you actually do is create a template page, based on which all the other pages are derived. Therefore, all the pages in the Web application inherits some common sections of that master page, which maintains consistency in the Web application.
What is the need of Master Pages and Themes in ASP.NET

Need For Master Pages and Themes 

When you want to create Web pages that contains some common elements and customize the properties of different controls, such as Buttons, TextBox and Labels, master pages and themes are needed. For example, you want to create a website for your company in which all the Web Pages have a header stating the company name and all the buttons on the Web pages are of blue color. You can create this website by using master pages and themes.
Master page is a feature in ASP.NET that helps define the overall layout of a Web application and reuse the defined layout in all the pages derived from the master page, A master page contains markups and controls that you can share across different Web page of your website . This makes your website more manageable and also avoids the duplication of code. To understand the need of master pages, Let's consider a scenario.
Suppose you want to include a navigation bar at a common place in all the Web pages of your website. If you are not using a master page , You will have to copy and paste the code for the common navigation bar on each page, which obviously is tedious and time consuming process. Also, if later you want to change the navigation bar slightly, then you will have to manually change the navigation bar code in all the pages of the Web application. Therefore, this does not seem to be a right way to bring consistency in your applications. However, if you are using master pages, you just need to include the navigation bar code in the master page, and all the Web pages will inherits it. It means no overhead of copying and pasting the code in different pages is required. Themes are needed when you want to keep the style and layout information files separate from other website files.
Protected by Copyscape Online Copyright Protection Software

0 comments :

Post a Comment

 
Toggle Footer
Top