Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In my web part I have an label, which I want to be localized:

<asp:Label ID="AppJSTNameLabel" runat="server" Text="<%$Resources:AppListWebPart,NoSelection%>" />

I have mapped Resources folder and created there files: AppListWebPart.resx and AppListWebPart.pl-PL.resx.

Both resource files contain NoSelection key with appropriate translations, but every time I deploy and test my web part, I'm getting:

Parser Error Message: The resource object with key 'NoSelection' was not found.

This drives me crazy. Any idea what I might be doing wrong?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

When adding resources to mapped Resource folder you are placing resx files to <hive>\xx\Resources\ folder and your web part cannot access them.

Proper place for this kind of resource is IIS application App_GlobalResources folder (x:\Inetpub\wwwroot\wss\VirtualDirectories\<port>\App_GlobalResources\).

Fore more info you can read SharePoint Internals: Resources (a bit old but it covers your issue).

If you are using 2010 with VS 2010 then you just add Module item to your project, delete all files included by default, put your resx inside it and use item properties on resx item to set Deployment Type : AppGlobalResource

For 2007 you can use: SharePoint Resources, Types, Use and Deployment

share|improve this answer
    
issue solved, thank you :) –  jjczopek Oct 6 '11 at 11:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.