Visual Studio - Master Page

by
Jeremy Canfield |
Updated: March 12 2020
| Visual Studio articles
To create a master page in Visual Studio:
- In Visual Studio, on the right (solution explorer), hover over the name of our site, right-click and select Add > New Folder
- Name the new folder MasterPages
- With the MasterPages folder highlighted press Ctrl + Shift + A (or right-click and select Add > New Item)
- In the Add New Item pop-up box, select Web Forms Master Page and select Add. Name this main.master.
- Switch to design view and type Master Page
To create a page that uses the main.master page:
- In solution explorer, highlight the name of your site and press Ctrl + Shift + A (or right-click and select Add -> New Item)
- In the Add New Item pop-up box, select Web Forms with Master Page and select Add. Name this default.aspx.
- When prompted to select our a master page, select main.master
- Switch to design view and type Default Page
You can now publish your site, and your default.aspx page should display both Master Page and Default Page.
Did you find this article helpful?
If so, consider buying me a coffee over at