SharePoint 2010: Visual Studio 2010

I have requirement : i have one web part and using custom web part property i load 4 different user control.

Solution 1 : I created web part and using custom web part property I load the different user control.[This deploys successfully and works as expected ]

Solution 2 : Can I use Visual web part for the same ? i tried creating the visual web part and added 3 user control (+ 1 default user control by visual web part).After deploying , 14 hive contained only the default user control not the other 3 user control.

Question : Can i achieve the same using visual web part .If Not , any justification?

link|improve this question

29% accept rate
feedback

1 Answer

Visual Web part basically does the same as solution 1, as it loads a user control in CreateChildControls (the exception is a Sandboxed visual web part, where the codebehind for the usercontrol inherits from webpart).

Since user controls doesnt show up in CONTROLTEMPLATES: did you remember to set the added user controls as DeploymentType: TemplateFile?

enter image description here

link|improve this answer
can u explain your statement "did you remember to set the added user controls as DeploymentType: TemplateFile?" in more detail – Monica Jagani Jun 16 '11 at 11:11
sure. i added a screenshot of the property in question – Anders Rask Jun 16 '11 at 14:04
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.