In Sharepoint provisioning resources are stored in 14/Resources folder. In order to use the same resource literals declaratively e.g. in page layouts (remember that uncustomized page layouts are retrieved in 14/Template/Features subfolder, which is not even virtual folder. Nevertheless it is possible to use resources in them declaratively – see below) you may need to copy them to App_GlobalResources folder of your web application in IIS (e.g. C:\inetpub\wwwroot\wss\VirtualDirectories\MyWebApp80\App_GlobalResources). If you worked with Sharepoint 2007 you probably know that there is special stsadm command which makes similar things: copyappbincontent. In this post I will show how to achieve the result using only Visual Studio features.
In order to do that at first double click on your package in VS solution tree:
Then in opened package window click “Manifest” tab. Scroll content and below the window you will find Edit options section:
Expand it and write the following in text area:
In this example I assume that your provisioning resources are stored in Resources mapped folder in Visual Studio (this is common scenario). After that package wsp and deploy it. After that check App_GlobalResources folder of your web application. It should contain Resources subfolder with provisioning resources copied in it. The fact that resx files are located in subfolder should not worry you. ASP.Net allows using resources from subfolders of App_GlobalResources, so you will be able to add literals to your page layouts by standard way:
And this is useful, because as I said page layouts are located not in virtual folder. In virtual folders like 14/Template/Layouts or 14/Template/ControlTemplates you may create App_LocalResources using default ASP.Net convention (resource file should be the same as page or user control file name with “.resx” extension, e.g. MyControl.ascx.resx) and use resources even simpler without resx file name prefix:
This technique allows to use standard ASP.Net expressions for resources in page layouts.