Wrox Programmer Forums
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 29th, 2006, 03:10 AM
Registered User
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Master Page File Reference


I'm completely new to Master Pages, and I am trying to get them to work with Microsoft Office SharePoint Server 2007. In MOSS, you can specify what master page to use via the line


Now, the standard, out-of-the-box reference is:


I have a new master page file called district.master created, and so I go into my default.aspx and put the following in


And then I go to the web site, and I get the error "The file or folder name contains characters that are not permitted. Please use a different name."

But if I then rename the district.master to default.master, it works fine... so I know my district.master file isn't messed up.

It appears that something is only allowing files by the name of default.master to act as master pages. Does anyone have any ideas as to how I may be able to get around this? I know this isn't a MOSS forum, but since it is built off of ASP.net 2.0, I thought maybe this is an ASP issue more than a MOSS issue.

Any assistance is appreciated.

Old February 2nd, 2007, 06:50 AM
Registered User
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I'm suffering from the same issue. Has anyone resolved this?



Old February 7th, 2007, 12:26 PM
Registered User
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

You can only use 'default.master' or 'custom.master' as strings. If you download the Windows SharePoint Services 3.0: Software Development Kit (SDK) from here: http://www.microsoft.com/downloads/d...displaylang=en

and navigate to section: "Customizing Master Pages in Windows SharePoint Services", this will state the following:

Referencing the Master Page from a Content Page
Windows SharePoint Services provides several tokens to reference the master page—two dynamic tokens ("~masterurl/default.master" and "~masterurl/custom.master") and two static tokens ("~site/default.master" and "~sitecollection/default.master").

Hope this works for you. Suggest you use the token 'custom.master' to avoid an unsupported scenario. You may also upload the master pages to the MOSS gallery as per http://msdn2.microsoft.com/en-us/library/aa830818.aspx.

The SDK could have been a bit clearer.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 7 Object reference error in master.cs mikeal_a BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 September 5th, 2008 07:19 AM
cross-page posting within pages with master file.. poogles ASP.NET 2.0 Basics 2 August 6th, 2007 05:11 AM
master page or #include file aspsuraj BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 December 2nd, 2006 02:17 PM
how to reference user control in master page.. gbianchi ASP.NET 2.0 Basics 1 May 1st, 2006 09:26 AM
Page reference in cs file jacob ASP.NET 1.0 and 1.1 Basics 1 July 22nd, 2003 10:37 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.