Sunday, September 27, 2015

CREATING MASTERPAGE

MASTER PAGES

ASP Master Pages allow you to create a consistent layout for the pages in your application.
A single master page defines the look and feel and standard behavior that you want for all of the pages in your application. You can then create individual content pages that contain the content you want to display.
When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.
We know that .Net is a Framework in which we can create web applications and Master page is common page 

Introduction


The Master Page is very important for web application or website. In Asp, We use type of page for connecting many several pages. It is a common page of the web application. In this page on we are design the color menu and feel looking of the website
  • A Master page provides a template for other pages
  • Give a shared layout and functionality 
  • The master page defines placeholders for the content which give user content pages
  • The Output result is a combination of the master page and the content page 

Adding Master Pages in a web application 

Following are the steps to add master page in web application:

Step1: Open Microsoft Visual Studio 2010(IDE) and file menu on IDE




Step2: Create a website application in IDE with C#. Give the name of the website in the bottom of given pop-up menu and then click on Ok button. After add a new empty website and then right side in IDE open Solution Explorer and right click



Step3: Select the option Add New Item open a dialog box and select the Master Page click on add button
Give the name of the Master Page in the bottom of given pop-up menu and then click on Ok button.



Step4: Right Click Solution Explorer, Create New Folder “images” Copy and Paste any image to New folder “images”

Step5: Paste the code between opening and closing form tags in “MasterPage.Master” Source Page


Step 6: Click on “MasterPage.Master” Design Page to view added image in Master Page


Step7: Implementing a new Web Form with Master Page’s style. Right sides in IDE open Solution Explorer and right click Add New Item->Web Form. Give the name of the web form in the bottom of given pop-up menu, check the “Select master page” and then click on Ok button.




Step8: Then select the Master Page from project Folders and click Ok button


Step9: Now, Web Form with “MasterPage.Master” Design


Step10: Adding Master Pages in a web application finished

No comments:

Post a Comment