如何以编程方式更改sharepoint webpart属性 [英] how to change sharepoint webpart properties programatically

查看:86
本文介绍了如何以编程方式更改sharepoint webpart属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面上放置了自定义sharepoint webpart ...

I have placed custom sharepoint webpart on page...

我想以编程方式更改webparts属性(高度,宽度)....

I want to change webparts property(height,width) programatically....

所以来自其他一些sharepoint页面 我调用webpart存在的页面我可以看到带有属性的webaprt我 设置..

so when from some other sharepoint page  I call page where webpart is present I could see webaprt with properties I  set..

我们可以实现这个吗?

 

任何链接都有用。 ...

any links would be useful....

-Shwetank

-Shwetank

推荐答案

你好Shwetank,

Hello Shwetank,

在您的webpart中,您可以访问CreateChildControls方法中的标题,宽度,高度属性等所有属性。

In your webpart you can access all the properties like Title, Width, Height properties in the CreateChildControls method.

您可以检查默认值WebPart的属性
here

You can check the default properties of WebPart here

ex; this.Title ="我的自定义WebPart";

ex; this.Title = "My Custom WebPart";

 

如果你想创建自定义webpart 属性,请查看
wictor wilen
的博客

If you want to create custom webpart  properties, check wictor wilen's blog


这篇关于如何以编程方式更改sharepoint webpart属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆