Click here to Skip to main content
15,883,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

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


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

please help me out.
Posted

1 solution

do u have another user control in layout folder.
bcs usercontrols r stored in layout folder.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900