Previous | Home | Next |
How to Add Master Page in Your Application
Adding a master page to your web
application is straight forward. Just right click on the project and select "Add
New Item" and than select "Master Page". This will add the master page to your
project.
The master page already has the content place holder control which is used to
hold and display your contents. Let's delete that content placeholder and add it
by our self. In this case we will create two content place holders. One will be
on the left and other one on the right .After you insert the content placeholder
control inside your table your master page will look something like this:
Using the master page in your aspx pages
Just add a new aspx page and name it as "first .aspx". Now you want to use the Sample1.master file in your aspx page. Just go to the html view of your page and add a Master Page File attribute in the page directive and delete all the other html that is written in the aspx page. The Master Page File attribute denotes that the Page is inheriting from the master page.
<%@ Page Master Page File="~/Sample1.master" %>
Previous | Home | Next |