Create Resource fasciculum Visual Bulla IDE
Effingo resource file in 12 alveare resource folder
GetLocalized method from SPUtility to read the values from resource file
Syntax:
SPUtility.GetLocalizedString(“$Resources:<<ResourceFileName,ResourceKeyName>>”, “<<ResourceFileName>>”, tantum);
Example:
SPUtility.GetLocalizedString(“$Resources:MyResources,FirstName”, “MyResources”, tantum);
Sample Source:
usura System;
usura System.Runtime.InteropServices;
usura System.Web.UI;
usura System.Web.UI.WebControls;
usura System.Web.UI.WebControls.WebParts;
usura System.Xml.Serialization;
usura Microsoft.SharePoint;
usura Microsoft.SharePoint.WebControls;
usura Microsoft.SharePoint.WebPartPages;
usura Microsoft.SharePoint.Utilities;
namespace ResourceFile
{
[Guid(“fc643df7-8836-41bf-913f-662ed57e659a”)]
publicas
class
ResourceCollection : System.Web.UI.WebControls.WebParts.WebPart
{
string FirstName;
string LastName;
publicas ResourceCollection()
{
}
protected
override
Irrita CreateChildControls()
{
base.CreateChildControls();
uint lang = SPContext.Current.Web.Language;
FirstName = SPUtility.GetLocalizedString(“$Resources:MyResources,FirstName”, “MyResources”, tantum);
LastName = SPUtility.GetLocalizedString(“$Resources:MyResources,LastName”, “MyResources”, tantum);
}
protected
override
Irrita Render(HtmlTextWriter writer)
{
writer.Write(“Value of First Name from Resource File : “ + FirstName);
writer.Write(“Value of Last Name from Resource File : “ + LastName);
}
}
}
Veri delicatus article. In mea blog et ego similia articulus in quam ut SPUtility.GetLocalizedString – http://dotnetfollower.com/wordpress/2011/05/the-usage-of-sputility-getlocalizedstring/