Master Pages not displaying ... ?

A

Andrew Kidd

Hi,

I've just been working through several examples of how to create Master
pages and then create content pages which are linked, but I cannot see the
Master page when I'm viewing the content page in "Design", nor do I see it
when I'm viewing the page in the browser.

I'm adding the Master page through the Add New Item dialog, and creating Web
Forms with the "Select Master Page" option checked, then selecting the
Master page from the subsequent dialog.

I've tried the web application both using the VS 2005 built-in webserver and
my local IIS ... but nothing seems to work.

Is there anything obvious that I'm doing wrong?

Thanks in advance

PS Running Windows XP Pro on my laptop and here's a dump from the VS about
box ...

Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727

Installed Edition: Professional

Microsoft Visual Basic 2005 77626-009-0000007-41131
Microsoft Visual Basic 2005

Microsoft Visual C# 2005 77626-009-0000007-41131
Microsoft Visual C# 2005

Microsoft Visual C++ 2005 77626-009-0000007-41131
Microsoft Visual C++ 2005

Microsoft Visual J# 2005 77626-009-0000007-41131
Microsoft Visual J# 2005

Microsoft Visual Web Developer 2005 77626-009-0000007-41131
Microsoft Visual Web Developer 2005

Crystal Reports AAC60-G0CSA4B-V7000AY
Crystal Reports for Visual Studio 2005


SQL Server Analysis Services
Microsoft SQL Server Analysis Services Designer
Version 9.00.1399.00

SQL Server Integration Services
Microsoft SQL Server Integration Services Designer
Version 9.00.1399.00

SQL Server Reporting Services
Microsoft SQL Server Reporting Services Designers
Version 9.00.1399.00
 
A

Andrew Kidd

Thanks for the reply.

Here's the source:

<%@ Master Language="VB" CodeFile="MasterPage.master.vb"
Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Master Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
<img alt="imgLogo" id="imgLogo" src="images/oreilly_logo.gif" />
<img alt="imgHeader" id="imgHeader"
src="images/oreilly_header.gif" /><br />
<hr />
</asp:contentplaceholder>
</div>
</form>
</body>
</html>
 
A

Andrew Kidd

Thanks for the reply.

I've got the default ContentPlaceHolder provided, into which I've put a
couple of images and a horizontal rule,

Here's the source:

<%@ Master Language="VB" CodeFile="MasterPage.master.vb"
Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Master Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
<img alt="imgLogo" id="imgLogo" src="images/oreilly_logo.gif" />
<img alt="imgHeader" id="imgHeader"
src="images/oreilly_header.gif" /><br />
<hr />
</asp:contentplaceholder>
</div>
</form>
</body>
</html>
 
G

Guest

There is nothing to display in the masterpage apart from the default images
that are within the ContentPlaceholder this will only display if you do not
have a Content section that has a ContentPlaceHolderID="ContentPlaceHolder1"
property in you child page. e.g. like below

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server"></asp:content>

If you have the above line in your child page then it won't display anything
from the master page because there is nothing to display.
 
N

NIan

it looks like you have default content in the Master Page,
If the Child Page have the contentId equal to your default contentId
it will replace the content in the default contentId,
so ContentPlaceHolder1 int your child page, be empty because there is
no content in the child content.

if you want to have the content share through out entire website.
bring the default content in the master page,
and put it out side of the contentplaceholder
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top