Nesting a SharePoint Webpart inside of a User Control

Posted by jlech on Stack Overflow See other posts from Stack Overflow or by jlech
Published on 2010-05-04T20:11:03Z Indexed on 2010/05/04 20:18 UTC
Read the original article Hit count: 181

I know it's usually the other way around, but I have some extenuating requirements that must be met (read as "No one bothered to do the research and now I have to bail them out")

I have a standard user control (ascx) that is to be imported into a SharePoint 2007 website. Due to a design constraint, a sharepoint web part that is also needed has to be nested inside of this user control.

So in other words, the user control would have to look something like this:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="foo.ascx.cs" Inherits="foo" %>
<div id="container">
...snipped...
<!-- SharePoint web part goes here -->
...snipped...
</div>

Any help would be appreciated.

Thanks!

© Stack Overflow or respective owner

Related posts about sharepoint2007

Related posts about ASP.NET