Wednesday, April 7, 2010

Master page is New Feature of ASP.NET 2.0 !!!!!!!!!!!!!!!

Master page is one of the great features of ASP.NET added with the ASP.NET 2.0. Using Master pages, we can give our web pages consistent look and maintainable user interfaces. A Master page can give your pages a definite look that you want for all the Web pages created in ASP.NET 2.0 or latest version of ASP.NET. After this, you need to create Content Page by right clicking on Master Page. The entire Content page created in this way will have a defined look that you have used in Master page.
Generally, A Professional Web Site has a customized look in the web pages. For Example- A customized Menu in the left side or after the title or Company’s Logo, Content in the Middle part and a copyright or all the pages information of the site in small font on the bottom. You just need to change the content part of every web page according to the name and behavior of the pages.
With the advent of Master Pages in ASP.NET 2.0, It has become easier for ASP.NET Web Developer to use same template in every pages.

Steps to Use Maser page in ASP.NET Website:

1.Open ASP.NET 2.0

2.File -> New Web Site. Select ASP.NET Web page and give the Name and  Location of it where you want save it.

3. Go in Solution Explorer and right click on the Web Site and select  Add New Item. A dialogue box will appear. Select Master Page and  give the name of it. Keep in mind the Extension of it always should  be .Master.

4.Now the Master page has been added. Design it according to you want  keep each and every pages of that website. Now right click on Master  Page and click on Add Content Page. You will notice the entire  content page have the same look you have designed in Master Page.

No comments:

Post a Comment