Quam ut Utor Resource File in SharePoint 2007

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);

}

}

}

1 Quam ut Utor Resource ad comment in File SharePoint 2007

Aliquam pharetra

Vos can utor his HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>