将多个用户控件添加到sharepoint 2010 webpart [英] Adding more than one usercontrols to sharepoint 2010 webpart

查看:89
本文介绍了将多个用户控件添加到sharepoint 2010 webpart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在sharepoint 2010中有一个webpart,必须在该webpart中添加一个带有可配置属性的usercontrol(.ascx)。这是可能的。 。这个在普通网页(.aspx)中正常工作,但它在Sharepoint中不起作用,它显示错误,如'。在此页面中不允许使用filename.ascx。[即一个带有可配置属性的usercontrol我们可以添加任何webpart .---这是实际要求]



我尝试在页面加载中加载usercontrol,它工作正常,但我无法添加属性。 />


Hi,

I have one webpart in sharepoint 2010,have to add one more usercontrol(.ascx) in that webpart with configurable property.Is it possible..This one is working fine in normal webpage(.aspx),but it is not working in Sharepoint ,it shows error like ''filename.ascx is not allowed in this page.[i.e one usercontrol with configurable property we can add any webpart.---this is the actual requirement]

I tried load the usercontrol in page load,it is working fine,but i can not add the properties.

protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
UserControl control = (UserControl)Page.LoadControl("/DropdownData.ascx");
Controls.Add(control);
}





在上面的示例中,我必须为DropdownData(下拉列表)添加属性(高,宽,数据源)在webpart文件中。



请帮帮我。



In the above example i have to add properties(hight,width,datasource) for DropdownData(dropdownlist) in webpart file.

please help me out.

推荐答案

你在布局中有另一个用户控件吗?文件夹。

bcs usercontrols r存储在布局文件夹中。
do u have another user control in layout folder.
bcs usercontrols r stored in layout folder.


这篇关于将多个用户控件添加到sharepoint 2010 webpart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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