Kif għandek tuża fajl tar-riżorsi fl SharePoint 2007

Oħloq fajl Riżorsi jużaw Visual Studio IDE

Kopja tal-fajl tar-riżorsi fis 12 folder riżors doqqajs

GetLocalized metodu minn SPUtility biex taqra l-valuri minn fajl riżorsa

Sintassi:

SPUtility.GetLocalizedString(“$Riżorsi:<<ResourceFileName,ResourceKeyName>>”, “<<ResourceFileName>>”, twil);

Eżempju:

SPUtility.GetLocalizedString(“$Riżorsi:MyResources,FirstName”, “MyResources”, twil);

Sors Kampjun:

bl-użu Sistema;

bl-użu System.Runtime.InteropServices;

bl-użu System.Web.UI;

bl-użu System.Web.UI.WebControls;

bl-użu System.Web.UI.WebControls.WebParts;

bl-użu System.Xml.Serialization;

bl-użu Microsoft.SharePoint;

bl-użu Microsoft.SharePoint.WebControls;

bl-użu Microsoft.SharePoint.WebPartPages;

bl-użu Microsoft.SharePoint.Utilities;

namespace ResourceFile

{

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


pubbliku
klassi
ResourceCollection : System.Web.UI.WebControls.WebParts.WebPart

{


sekwenza FirstName;


sekwenza LastName;


pubbliku ResourceCollection()

{

}


protetti
override
null CreateChildControls()

{


bażi.CreateChildControls();


uint lang = SPContext.Current.Web.Language;

FirstName = SPUtility.GetLocalizedString(“$Riżorsi:MyResources,FirstName”, “MyResources”, twil);

LastName = SPUtility.GetLocalizedString(“$Riżorsi:MyResources,LastName”, “MyResources”, twil);

}


protetti
override
null Tirrendi(HtmlTextWriter kittieb)

{

writer.Write(“Valur ta 'Prim Isem minn Resource File : “ + FirstName);

writer.Write(“Valur ta Last Isem minn Resource File : “ + LastName);

}

}

}

1 kumment li Kif Użu tar-Riżorsi File fl SharePoint 2007

Leave a Reply

Tista 'tuża dawn it-tags HTML

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