Tip #92: Did you know … How to select a master page using 'Select a Master Page' dialog?

Master page for a Web form can always be set manually in the source code, but here is an option to select the master page while create the webform using the 'Select a Master Page' dialog.

The path to select a Master page using the 'Select a master page' dialog is different for a Web application project than for a Web site.

 
For a Web Application project:

  1. Right click solution explore. Select Add and then select New Item

    image

  2. From the Add new Item dialog select Web content form and click on Add button.

    image

  3. Select a Master Page dialog would appear. Navigate thru the project folders to select the Master page & click on OK button. The aspx added would now be using the selected master page.

    image

 
For a Web site project:

  1. While adding a Webform, check the select master page checkbox and click on the Add button.

    image

  2. Select a Master Page dialog would appear. Navigate thru the project folders to select the Master page & click on OK button. The aspx added would now be using the selected master page.

    image

Hope this helps,

Deepak Verma
SDET | Visual Web Developer