I have a SharePoint application and for that I have created resource files which are inside App_GlobalResources folder.

I am making a visual web part and want to use those resource files rather than creating my own. How to do that?

1 Answer 1


There are two ways to use resource file.

In .ascx file:

<asp:Label ID="lbl1" runat="server" Text="<%$Resources:ResourcesFileName, ResourceFileItemKey %>"

And in .cs file use SPUtility.GetLocalizedString() method

For the second option your resource file should be present in sharepoint mapped resources folder.

For more details visit this link

Note: I have trouble using resource file in .ascx file. For more details visit this link


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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