Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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

share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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