Click here to Skip to main content
13,049,263 members (68,147 online)
Rate this:
Please Sign up or sign in to vote.

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)
UserControl control = (UserControl)Page.LoadControl("/DropdownData.ascx");

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

please help me out.
Posted 6-May-13 20:54pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 7 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100