Click here to Skip to main content
15,902,922 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to i convert and use HTML Page template into a masterpage in asp.net?
Posted

1 solution

The master page looks very similar to an ASPX file, except a master page will have a .master file extension instead of a .aspx extension, and uses an @Master directive instead of an @Page directive at the top. Master pages will define the <html>, <head>, <body >, and <form> tags. You will also want to add ContentPlaceHolder controls in the master page. ContentPlaceHolder controls are where we want our ASPX web forms to place their content.

So, if you want to convert the template to master page, you need to do:

1. Use @Master directive instead of @page directive;

2. Add one or more contentplaceholder controls on the page;

3. Use .master file extension instead of the .aspx extension.

I suggest you first create a new ASPX page which you copy from your existing page, then cut down to just the common elements before converting it to a master page. It is also worth creating a new master page so that you have an example to work from.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900