Welcome to Dream.In.Code
Getting Help is Easy!

Join 117,270 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,798 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



ASPX & Master Page

 
Reply to this topicStart new topic

ASPX & Master Page

Jonson
post 1 May, 2008 - 07:06 PM
Post #1


New D.I.C Head

*
Joined: 17 Apr, 2008
Posts: 40

I am using ASP.NET, visual studio 2005. I want to add existing item to my project website, but how do i link my master page to them? i know whenever i add new item, i can select master page for the new Default.aspx.

This post has been edited by Jonson: 1 May, 2008 - 08:21 PM
User is offlineProfile CardPM

Go to the top of the page


jayman9
post 2 May, 2008 - 01:22 PM
Post #2


Student of Life

Group Icon
Joined: 26 Dec, 2005
Posts: 6,438



Thanked 27 times

Dream Kudos: 500

Expert In: C#, VB.NET, Java

My Contributions


When you add a new item there is a checkbox near the bottom of the screen that you can check to Add Master Page. Put a check in it, then when you click OK, another screen will open allowing you to select the master page.
User is offlineProfile CardPM

Go to the top of the page

thor78
post 6 May, 2008 - 05:57 PM
Post #3


D.I.C Head

Group Icon
Joined: 6 May, 2008
Posts: 106



Dream Kudos: 50
My Contributions


For existing files, select the .aspx, press F4 to access it's properties, look for the MasterPageFile property and click on the "..." to select a master file from your file system (or IIS). Then to put your contents to the ContentPlaceHolder (assuming you already placed at least one ContentPlaceHolder in the master page) by creating the asp control <asp:Content> and move the contents in between content tags.

Your existing file should look something like this:
CODE

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
    MasterPageFile="~/MasterPage.master" %>

<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server" ID="Content1">
    <p>your HTML here!</p>
<</asp:Content>
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/6/08 10:21PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month