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

I want to load a user control like in a regular web part but in a mobile web part.

The regular method of doing it:

private const string _ascxPath = @"~/_CONTROLTEMPLATES/WP7.SP.MobileWebPart/MobileWebPart/MobileWebPartUserControl.ascx";

protected override void CreateChildControls()
{
    Control control = Page.LoadControl(_ascxPath);
    Controls.Add(control);
}

How do I do it in a mobile web part?

share|improve this question
    
Welcome to SharePoint Stack Exchange! A well written question encourages people to answer it. Please read our guidelines which I've used to improve your post. You can also read How to Ask for more general guidelines. –  Alex Angas Aug 1 '11 at 8:56
add comment

1 Answer

I don't have experience with mobile development myself, but recently some mobile labs were released: http://msdn.microsoft.com/en-us/SharePointAndWindowsPhone7TrainingCourse_CreatingMobileWebPartsLab . It looks like that you already took some code from that lab, but I would suggest you to follow the lab completely: you will learn about mobile adapters, then.

share|improve this answer
add comment

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.