开发者

Nesting a SharePoint Webpart inside of a User Control

开发者 https://www.devze.com 2022-12-29 07:47 出处:网络
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 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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号