Nola Baliabideen SharePoint-en fitxategi erabiltzea 2007

Sortu Baliabideen fitxategia Visual Studio IDErekin

Kopiatu baliabide-fitxategia sartu 12 hive errekurtsoen karpeta

GetLocalized method from SPUtility to read the values from resource file

Sintaxia:

SPUtility.GetLocalizedString(“$Baliabideak:<<ResourceFileName,ResourceKeyName>>”, “<<ResourceFileName>>”, bakarrik);

Adibidea:

SPUtility.GetLocalizedString(“$Baliabideak:MyResources,FirstName”, “MyResources”, bakarrik);

Sample Iturria:

erabiliz System;

erabiliz System.Runtime.InteropServices;

erabiliz System.Web.UI;

erabiliz System.Web.UI.WebControls;

erabiliz System.Web.UI.WebControls.WebParts;

erabiliz System.Xml.Serialization;

erabiliz Microsoft.SharePoint;

erabiliz Microsoft.SharePoint.WebControls;

erabiliz Microsoft.SharePoint.WebPartPages;

erabiliz Microsoft.SharePoint.Utilities;

namespace ResourceFile

{

[Guid(“fc643df7-8836-41bf-913f-662ed57e659a”)]


publikoa
class
ResourceCollection : System.Web.UI.WebControls.WebParts.Web

{


katea FirstName;


katea LastName;


publikoa ResourceCollection()

{

}


protected
override
void CreateChildControls()

{


base.CreateChildControls();


uint lang = SPContext.Current.Web.Language;

FirstName = SPUtility.GetLocalizedString(“$Baliabideak:MyResources,FirstName”, “MyResources”, bakarrik);

LastName = SPUtility.GetLocalizedString(“$Baliabideak:MyResources,LastName”, “MyResources”, bakarrik);

}


protected
override
void Render(HtmlTextWriter writer)

{

writer.Write(“Value of First Name from Resource File : “ + FirstName);

writer.Write(“Value of Last Name from Resource File : “ + LastName);

}

}

}

1 comment to How to Use Resource File in SharePoint 2007

Iruzkin bat idatzi

Erabil dezakezu HTML tags horiek

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