views:

61

answers:

1

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!

A: 

WebParts are all controls, so you can add a web part just as you would a regular control. As long as the web part isn't doing anything unusual like accessing a paren web part zone, you shouldn't need anything beyond a register directive in the ascx header or web.config.

Tom Clarkson