Visual Studio 2008 - Master Page Error

S

Steve LaForge

I have an intranet site and want to create a simple master page to be shared
across all applications that are built for that site. I build my master page
in c:\inetpub\wwwroot\Masters as CTMNet.master and I have tested it with no
problems.

I am now trying to use VS2008 to build my first application which would
reference the master page. I created a virtual directory that points to
c:\inetpub\wwwroot\masters, and my page starts with:

<%@ Page Title="" Language="VB" MasterPageFile="~/Masters/CTMNet.master"
AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ MasterType VirtualPath="~/Masters/CTMNet.master" %>

When I run the page, it works fine, but in VS2008 Designer mode, I get the
error "Master Page error - The Master page file
'http://localhost/SiteInfo/Masters/CTMNet.naster' cannot be loaded. Correct
the problem in code view." The designer is disabled. There are two errors
that show up in the error window. They are the same, but repeated once for
each of the lines shown above. The error is 'The file
'/SiteInfo/Masters/CTMNet.master' does not exist.'

How do I correct this???

Thank you!!!
 
J

Jeff Dillon

Steve LaForge said:
I have an intranet site and want to create a simple master page to be
shared
across all applications that are built for that site. I build my master
page
in c:\inetpub\wwwroot\Masters as CTMNet.master and I have tested it with
no
problems.

I am now trying to use VS2008 to build my first application which would
reference the master page. I created a virtual directory that points to
c:\inetpub\wwwroot\masters, and my page starts with:

<%@ Page Title="" Language="VB" MasterPageFile="~/Masters/CTMNet.master"
AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ MasterType VirtualPath="~/Masters/CTMNet.master" %>

When I run the page, it works fine, but in VS2008 Designer mode, I get the
error "Master Page error - The Master page file
'http://localhost/SiteInfo/Masters/CTMNet.naster' cannot be loaded.
Correct
the problem in code view." The designer is disabled. There are two
errors
that show up in the error window. They are the same, but repeated once
for
each of the lines shown above. The error is 'The file
'/SiteInfo/Masters/CTMNet.master' does not exist.'

How do I correct this???

Thank you!!!

c:\inetpub\wwwroot\masters is your root now on a virtual directory. What did
you try?

I'm assuming MasterPageFile="CTMNet.master" would work

Jeff
 
S

Steve LaForge

--
Steve LaForge
Sodexo Clinical Technology Management


Jeff Dillon said:
c:\inetpub\wwwroot\masters is your root now on a virtual directory. What did
you try?

I'm assuming MasterPageFile="CTMNet.master" would work

Jeff
I have a virtual directory titled Masters that is a subdirectory in my app.
The directory structure is in IIS is:
Default Web Site
- SiteInfo
- Masters (contains the CTMNet.master page)

The SiteInfo directory contains my default.aspx page that is attempting to
refer to ~/Masters/CTMNet.master.

Changing the references from "~/Masters/CTMNet.master" to "CTMNet.master"
made the problem worse, not better. It won't even launch with the change.
It will launch and run in IE as is, it is just that I get this error in
VS2008.

I am TRYING to follow Microsoft's recommendation for how to share a master
page across multiple applications. I would like to be able to maintain the
master page in one location.

Thanks!
Steve
 
J

Jeff Dillon

I am TRYING to follow Microsoft's recommendation for how to share a master
page across multiple applications. I would like to be able to maintain
the
master page in one location.

Thanks!
Steve

So you have a master page working without trying to share between
applications I assume. Where are you reading about the MS recommendations?
 

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

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top