What exactly does the MasterPageFile="~masterurl/default.master" in the page mean?

Hi Everyone,
I want to create a site definition that use my own master page in the homepage (VS2012 + SP2010). When the site definition is created, there are already codes in the default.aspx page that simply display a string in the body. And the page refers to a
master page at ~masterurl/default.master.
My question is, where exactly does ~masterurl point to? I want to use my own master page to replace it, but when I change it to any other location rather than
~masterurl/default.master, it gives me an error saying file not found.
So could anyone tell me how can I use my own master page in the default.aspx page? I tryied to place my master page file in the LAYOUTS folder and refer to it using
MasterPageFile="_layouts/site.master" but it does not work, either.
Thanks in advance.
Cavendish Feng

Taken from http://msdn.microsoft.com/en-us/library/office/ms476046(v=office.12).aspx
Dynamic token "~masterurl/default.master"
This token references a master page from a content page by using the MasterPageFile attribute together with the value of the MasterUrl property.
As an example, in the following page directive, <%@ Page MasterPageFile="~masterurl\default.master"%>, the token "~masterurl/default.master" is replaced at run time by the value in the MasterUrl property.
This property contains the server-relative full path to the master page, including file name.
Notice the article is talking about these dynamic tokens which are automatically substituted at runtime. Which is what you're seeing.
Static tokens are explained here; http://rehmangul.wordpress.com/2009/12/15/master-pages-in-sharepoint/
basically you have to be careful what path you're specifying, depending on the location of the page.
w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP

Similar Messages

  • ~masterurl/default.master doesnt work?!

    Hi,
    i have a DocumentTemplate and store instances of this in a documentLibrary.
    The DocumentTemplate has this Page def.:
    <%@ Page Language="C#" CodeBehind="SimpleArticlePage.aspx.cs" Inherits="MyCustom.ArticlesManagement.SimpleArticlePage" MasterPageFile="~masterurl/default.master" %>
    If i try to open one of those files the error "File not found" is displayes because he tries to find the masterPage here:
    http://localhost/Lists/ArticleList/default.master
    Why the page doesnt replace the "~masterurl/default.master" with the right url?
    What do i need to do so the url will be replaced?
    cheers

    Hi,
    According to your description, my understanding is that the error
     “File not Found” exists using dynamic code "~masterurl/default.master".
    Please check the URL of the MasterPageFile about the system pages, such as AllItems.aspx. If it is different from yours, please change it.
    Please create a new page via SharePoint Designer and check the URL of the MasterPageFile. If it is different from yours, please change it.
    Please move the document template to another library or another library in another SharePoint site collection and test whether this issue occurs.
    Please change the dynamic token to other formats “~site/ActualFileName.master, 
    ~sitecollection/ActualFileName.master” and test whether this issue occurs.
    Best Regards,
    Dean Wang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • HT4859 when you go to do this it say that your iPod or whichever device will no longer be backed up to the computer it is currently backed up to, what exactly does that mean? Will i not be able to sync my iPod from that computer?

    when you go to do this it say that your iPod or whichever device will no longer be backed up to the computer it is currently backed up to, what exactly does that mean? Will i not be able to sync my iPod from that computer? Please help me and answer either or both question detailed thanks

    Normally when you sync your device it is automatically backed up to your computer as the first step in the sync process.  When you choose to start backing up your device to iCloud, iTunes stops automatically backing it up on your computer when you sync.  That's what the message is telling your; that you are now backing up to iCloud and not to your computer each time you sync.  You can still manually back up to your computer any time you want by going to the Summary tab and clicking on Back Up Now under Manually Back Up and Restore.
    You can still sync your device as you did before, it just will no longer back up automatically when you do.

  • What exactly does the AppleCare cover for MacBook Pro with Retina Display?

    I purchased the extended protection plan for my MacBook Pro with Retina Display 15" and my question is what exactly does it cover in what kind of situations (i.e. viruses, damaged ports, damaged charger, etc.)? I want to be able to take full advantage of the protection plan since it was a pretty big whole in my wallet.

    AppleCare covers all the problems you have with your MacBook Pro with Retina display and the peripherals which came with it (your charger) if you have a hardware problem that you didn't cause. For example, after 2 or 3 years and 1000 charges, OS X says that your battery has to be replaced: in this case, you have to pay for the battery, because batteries have got a lifetime, and Unibody Macs batteries have got an average lifetime of about 1000 charges.
    However, if the RAM gets damaged and you haven't done anything to cause it, you will get your computer repaired or replaced for free. AppleCare in a MacBook Pro with Retina display is very important, because near all the parts are soldered into the logic board and repairs are expensive

  • My iPhone 4s was stolen this weekend and I did the Remote Lock.  What exactly does that do?  Also, if i do the Remote Wipe will that erase all of my data and impede anyone from ever using the phone?

    My iPhone 4s was stolen this weekend and I did the Remote Lock.  What exactly does that do?  Also, if i do the Remote Wipe will that erase all of my data and impede anyone from ever using the phone?

    The remote lock locks the iphone with a passcode that you set. By remote wiping the device it will simply restore it and clear it of all its data, but by doing this it will prevent you tracking it and communicating with it (e.g. remote locking it) in the future

  • So what exactly does limited to "one app" mean with a Pro account and the new prices?

    So it seems Pro has dropped in price but it is now limited to "one App".
    So what exactly does that "one App" mean?
    Only one tablet version or one phone version for a certain title?
    Or you can have a tablet & phone version including android & iOS for that one title?

    I think that everyone received it just now…
    Changes to Adobe Digital Publishing Suite, Professional Edition
    Effective immediately, all customers who newly purchase or renew Digital Publishing Suite (DPS), Professional Edition, will be able to publish only one app per license of DPS Professional Edition.
    Under this policy change, Professional Edition customers can publish an unlimited number of issues (.folio files) to a single app and distribute those issues based on purchased fulfillment bundles.
    An app created with a single license of DPS Professional Edition can be distributed to any or all of the marketplaces that DPS supports, including the Apple App Store (and Newsstand), Google Play, Amazon Appstore, and the Windows Store.
    In conjunction with this policy change, Adobe is reducing the price of a Professional Edition license to $4,800 USD annually (€3,600/¥480,000) or to $400 per month (€300/¥40,000) and will include 1,000 fulfillments annually. The number of fulfillments included with a monthly subscription remain unchanged.
    This policy does not apply to test or demo apps published using Professional Edition. The one-app-per-license policy applies only to an app published to a supported marketplace(s).
    If you are an agency, upon your renewal or purchase of Professional Edition, you can create only one app per Professional Edition license. If you have multiple clients for whom you are creating apps, either you as the agency or your client must purchase a Professional Edition license for each app published to a supported marketplace(s).
    If you are an existing Professional Edition customer and choose to renew your Professional Edition license at the end of your annual agreement, these changes, including the lower price point and 1,000 fulfillments, apply at that time. These changes do not apply to your existing DPS Professional Edition agreement and take effect only if you renew your license.
    DPS Professional Edition customers can continue to create unlimited Single Edition apps, which is unchanged under the new policy. A Single Edition app is defined as an app that includes one built-in or embedded folio.
    If you expect to publish three or more apps annually, we encourage you to contact your local reseller to discuss pricing for a multi-year Enterprise Edition license.
    Enterprise Edition offers additional functionality and benefits not available through Professional Edition. These include app customization, integration with back-end business systems, in-app marketing tools, targeted content based on user entitlement, and the ability to publish apps privately.

  • What exactly does the Radio Beacon Indicate

    I have seen cases where the Radio Beacon is black and when it is gray. When it's black you may or may not be able to go through the wireless router to the modem and then to the internet. When it is gray, you cannot really do anything except be in a local mode. However there are instances when the Radio Beacon is black, rather than gray, and you still cannot access the internet. So, what exactly does the activated Radio Beacon Indicate, i.e., that the wireless network is working and the modem is down, or something else entirely ?

    Assuming you're referring to the Airport icon in the menu bar, 'clear/empty' means Airport is turned off, gray bars means Airport is on but not connected to a network, and black bars means Airport is on and connected to a network. Other possible icon states are solid gray with a little computer inset, meaning you're connected to a computer-to-computer created on the Mac, and gray bars with an exclamation point (10.6 only), meaning connected to a network but not authenticated (e.g. wrong password for an 801.2X corporate/university network).
    To your question, it's perfectly possible to be successfully connected to a network (black icon) and unable to access the internet. Situations like that would include the network requiring a proxy server, for which you haven't set up the details on in Network Preferences, or you're connected to an open network that requires you to enter information or agree to terms (e.g. a hotel network, where you need to put in your room number and agree to the charges before you can connect to the internet).

  • What exactly does the global switch command line do ?

    Hello All
    Just foraging in the dark world of APP-V. I have a question which I cannot find answer for through google.
    There are powershell commands to publish an APP-V application globally. What exactly does the global switch do ?
    I understand it makes the application available to everyone on the machine for anyone who logs onto that machine.
    However in the absence of this global switch the application is still available to all users who logon to that particular machine. So what exactly is the reason for using the global switch ?
    Thanks

    Correct, the global switch makes the application accessable for all users logging on to that system.
    This feature is required for some packages, like Office. But it is ofter used for applications used by everyone, like Adobe Reader.
    However in the absence of this global switch the application is still available to all users who logon to that particular machine. So what exactly is the reason for using the global switch ?
    A package can be added to the system but until it is published a user cannot start it. They won't see any shortcuts in their startmenu/desktop/etc.
    So after you added the package to the system, it must be published to a user or globally (every user) to start it.

  • What "exactly" does the Brightness setting in Print do?

    What "exactly" does the Brightness setting in the Print module do?
    I know it's a controversial button, especially now that there are proofing options available. Also, since you're using it "blind" it's impossible to know how much or what it's really doing.
    Does anyone know if it's e.g.. the same as going to quick develop and going up on "exposure", or "brightness", or "shadows"... How exactly is it brightening the image, and is +100 a full stop or how is it calibrated?
    Thanks,
    Alan.

    Ooops,
    Obviously there is NO brightness control in LR...is the print adjustment similar to an exposure adjustment or more like moving the "shadows" and "whites" adjustments (which if I understand corrrectly, moves tones above or below mid tones, but not highlights or blacks)?

  • What exactly does the Work Offline option do in a shared review hosted on an internal server?

    Hi,
    What exactly does the Work Offline option do in a shared review hosted on an internal server?
    I *think* it simply disconnects you from the review server. I'm not sure why one would want to do this.
    I'm trying to recommend an offline workflow for reviewers who may not be able to access a shared review hosted on our internal server (for example, while traveling). These reviewers would like to be able to comment on an offline version of the review PDF and then publish their comments when they can again connect to the Internet/internal server.
    It doesn't seem like "Work Offline"  is the right fit for this scenario. Instead, should reviewers save a local copy to their hard drive, comment on it, and then, when reconnected to the Internet, open the local copy, click Reconnect to Server, and then click Publish Comments?

    Thanks, Dave. So for my hypothetical traveling reviewer, it would be reasonable to suggest the following steps for an offline workflow?
    1. Connect to the shared review.
    2. Choose Work Offline from the Server Status menu.
    3. Close and save the review PDF locally.
    4. Comment while traveling.
    5. When back in the office, open the local copy of the review PDF.
    6. Click Reconnect to Server.
    7. Click Publish Comments.

  • In Mac's PAINTR application, what exactly does the "Splash" function do?

    n Mac's PAINTR application, what exactly does the "Splash" function do?

    You might also post your question over in the Mac App Store section of the Community, where you might have a better chance of running into someone else using the Paintr App.
    Mac App Store: Apple Support Communities
    Dennis

  • What exactly does the M7 coprocessor do in the iPad air, and what apps can use it?

    I've been trying a few 3rd party apps which use the m7 in the iPhone 5s. None of them work. Also there seem to be no apps both built in motion activity under the privacy menu in settings.
    My question is, what exactly does the M7 coprocessor in the ipad air?

    http://en.wikipedia.org/wiki/Apple_M7
    http://www.imore.com/apple-m7
    http://www.tuaw.com/2013/10/10/seven-apps-that-take-advantage-of-the-m7-motion-c oprocessor-in-t/

  • What exactly does the colaece option do in TOAD software

    Hi,
    What exactly does the colaece option do in TOAD software.
    Regards,
    MuruguPandian P

    Coalesce will take ADJACENT free space and coalesce it into one larger free chunk.
    A free extent in a dictionary-managed tablespace is made up of a collection of contiguous free blocks. When allocating new extents to a tablespace segment, the database uses the free extent closest in size to the required extent. In some cases, when segments are dropped, their extents are deallocated and marked as free, but adjacent free extents are not immediately recombined into larger free extents. The result is fragmentation that makes allocation of larger extents more difficult.
    You should often use the ALTER TABLESPACE ... COALESCE statement to manually coalesce any adjacent free extents. To Coalesce a tablespace give the following command
    SQL> alter tablespace ica coalesce;
    Source: http://www.oracle-dba-online.com/tablespaces_and_datafiles.htm
    Regards
    Asif Kabir

  • HT201210 My iPhone became wet at the beach.  I put it in rice for 4 days.  When I connect to itunes, it says the phone must be restored.  It starts and then gives either the error 2001, or 2006.  What exactly does this mean, and is it worth getting repair

    My iPhone became wet at the beach.  I put it in rice for 4 days.  When I connect to itunes, it says the phone must be restored.  It starts and then gives either the error 2001, or 2006.  What exactly does this mean, and is it worth getting repaired?
    Thank you...

    http://support.apple.com/kb/TS1275
    Water damage isn't covered by warranty, but you could always purchase a refurbished device from Apple. 

  • Re: In Mac's PAINTR application, what exactly does the "Splash" function do?

    In Mac's PAINTR application, what exactly does the "Splash" function do?  It isn't mentioned in the Toolbox Documentation, but the "Splash" option is given right next to the "Draw" option at the top of the screen in the application itself.

    You might also post your question over in the Mac App Store section of the Community, where you might have a better chance of running into someone else using the Paintr App.
    Mac App Store: Apple Support Communities
    Dennis

Maybe you are looking for

  • How To Copy Selected Music From One Library to Another?

    What is the best way to copy selected music from one library to another? I have a big and growing iTunes library -- 33,000 songs. A year ago I copied my library to my daughter's new iMac.  Now, a year later, I'm off to visit her and wonder how best t

  • PCA and Balance Sheet Accounts

    My client wants to generate Profit Center Financial Statements e.g., Balance Sheet (B/S) and Profit and Loss (P&L)  The entire Chart of Accounts was assigned to Profit Centers, and all B/S and P&L accounts can be viewed in the GLPCT table.  This tabl

  • HT201317 don't see all of my picture, see in usage 6000 photos and videos but in photo see recently added

    don't see all of my picture, see in usage 6000 photos and videos but in photo see recently added 576 and 1486 videos what am i doing!?

  • Error in Shopping cart Approval workflow

    Hi Workflow experts, We are on SRM 5.0 with Extended classic scenario. I have activated & set the start conditions for No Approval workflow. The workflow for shopping carts end up in Error status. Message "Error changing to status RELS". upon further

  • How to have project specific logs in OSB

    Hi I make log entry in osb using Log Action and it works, as i can see logs in Server's log file. But it contains other log entries also... But i dnt know how do i have separate log file for my projects in OSB, ie how do have separate log file ,where