asp.net 2.0 master pages

ICW

Active member
Joined
Mar 27, 2006
Messages
25
Programming Experience
Beginner
Is it possible to add a master page after I have created a few pages and then link them retrospectively as opposed to creating the master page first?

I can't see how to do this, I have added a master page but I cannot get my other pages to see/use it.


thanks
ICW
 
Very simple! Just remove all the tags and leave the things that appear on the ceratin page.
Then add this lines to your page .aspx respectivelly entering the name of the master page and content.

VB.NET:
[SIZE=2]<%[/SIZE][SIZE=2][COLOR=#0000ff]@[/COLOR][/SIZE][SIZE=2][COLOR=#800000]Page[/COLOR][/SIZE][SIZE=2][COLOR=#ff0000]Language[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]="VB"[/COLOR][/SIZE][SIZE=2][COLOR=#ff0000]MasterPageFile[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]="~/MasterPage.master"[/COLOR][/SIZE][SIZE=2][COLOR=#ff0000]Title[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]=".:: TITLE ::."[/COLOR][/SIZE][SIZE=2] %>[/SIZE]
[SIZE=2] 
[/SIZE][SIZE=2][COLOR=#0000ff]<[/COLOR][/SIZE][SIZE=2][COLOR=#800000]asp[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]:[/COLOR][/SIZE][SIZE=2][COLOR=#800000]Content[/COLOR][/SIZE][SIZE=2][COLOR=#ff0000]ID[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]="Content1"[/COLOR][/SIZE][SIZE=2][COLOR=#ff0000]ContentPlaceHolderID[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]="ContentPlaceHolder1"[/COLOR][/SIZE][SIZE=2][COLOR=#ff0000]Runat[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]="Server">[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]
[/COLOR][/SIZE][SIZE=2][COLOR=green]  'the content goes here
 
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]</[/COLOR][/SIZE][SIZE=2][COLOR=#800000]asp[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]:[/COLOR][/SIZE][SIZE=2][COLOR=#800000]Content[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]>
[/COLOR][/SIZE]
 
Back
Top