Configuring a Web Part Header from a Resource File
I am trying to install a header and description web part via a resource file. My .webpart
file has this content:
<?xml version="1.0"?>
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="MyWebParts.MyWebPart" />
<importErrorMessage>Cannot import this web part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">$Resources:MyWebPartResources,WebPartTitle</property>
<property name="Description" type="string">$Resources:MyWebPartResources,WebPartDescr</property>
</properties>
</data>
</webPart>
</webParts>
I put the resource file in a folder 12\Resources
.
But the Add Web Part dialog doesn't seem to display the title and description from the resource file.
Has anyone fixed this?
Update-1: In the Add Web Part dialog box, I see the following instead of text in the resource file:
$Resources:MyWebPartResources,WebPartTitle
$Resources:MyWebPartResources,WebPartDescr
source to share
Link, SharePoint Internal Resources: Resources (given by anchorpoint in the comment) helped a lot. Lee Dale is also true. Although it still didn't work on my machine the first time I was right. Perhaps this is due to a caching issue.
Later I tried to clear the temporary internet files, deactivate and activate the function, it worked!
source to share