0

I am using the following code in my page layout file but I am getting error.

CODE

<%= SPUtility.GetLocalizedString("$Resources:NewsHeading", "myresourcefile", Thread.CurrentThread.CurrentUICulture.LCID) %>

ERROR

The name 'SPUtility' does not exist in the current context

How do I fix this?

  • Are you able to get it in cs page ? Also check if Sharepoint namespace is registered in aspx page. – Pushpendra Jul 26 '13 at 17:40
  • No idea what you mean by CS page. Yes I can see Sharepoint namespace mentioned on top of page but I think error is happening because of missing Microsoft.Sharepoint.Utilities namespace? If yes how do I define it? I mean I just write ; semicolon and then write the next namespace? – Frank Martin Jul 26 '13 at 17:57
2

This is the tag for Utilities registration on aspx page.

<%@ Register Tagprefix="Utilities" 
   Namespace="Microsoft.SharePoint.Utilities" 
   Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, 
   PublicKeyToken=71e9bce111e9429c" %>
  • Your code solved my problem but now I am getting error "The name 'Thread' does not exist in the current context". I tried to add Threading Class above but no luck. – Frank Martin Jul 27 '13 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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