本文找那个我们将学习如何在我们的WebPart中访问SharePoint 2010的14目录中保存的资源文件。作为例子,我们在其中放置了如下的资源文件。

<data name=”Button.Text” xml:space=”preserve”>
<value>Click me</value>
</data>
<data name=”Button.Tooltip” xml:space=”preserve”>
<value>Click me tooltip</value>
</data>
你可以在WebPart的CreatechlidControls中使用该按钮:

protected override void CreateChildControls()
{
Button b = new Button();
ResourceManager rm = new ResourceManager(“WebParts.ResourceWebPart.NonVisualWebPart”, this.GetType().Assembly);
b.Text = rm.GetString(“Button.Text”);
b.OnClientClick = “ShowAlert(this)”;
Controls.Add(b);
base.CreateChildControls();
}

参考资料

Programmatically get resource files in sharepoint 2010

相关文章:

  • 2022-12-23
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2021-06-26
猜你喜欢
  • 2021-12-14
  • 2022-12-23
  • 2022-03-08
  • 2022-12-23
  • 2021-05-21
  • 2021-08-15
  • 2021-07-24
相关资源
相似解决方案