Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 29th, 2006, 03:10 AM
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Master Page File Reference

Hi,

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

MasterPageFile=

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

MasterPageFile=~masterurl/default.master

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

MasterPageFile=~masterurl/district.master

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.

Thanks,
Chris
Reply With Quote
  #2 (permalink)  
Old February 2nd, 2007, 06:50 AM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Thanks,

Andy.

Reply With Quote
  #3 (permalink)  
Old February 7th, 2007, 12:26 PM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default


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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.