1. Create a folder in the root of your MOSS web application .

2. Add this folder as a Virtual Directory to your web application using IIS.

3. Copy the .ascx files you want to use into the new folder.

4. Build your assembly and copy it to the _app_bin folder in your Web Application.

5. Add this line to your Web Application's Web.Config, within the SafeControls section

<SafeControl Src="" IncludeSubFolders="True" Safe="True" AllowRemoteDesigner="True" />

6. Add another line to your Web Application's Web.Config, within the SafeControls section, for the Assembly. (oh yeh, you gotta generate a .snk (strong name) to get the values for the PublicKeyToken=)

<compilation batch="false" debug="true">
      <assemblies>
        <add assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add assembly=", Version=1.0.0.0, Culture=neutral, PublicKeyToken=" />
      </assemblies>

 

7. Add a page directive for the User Control you want to use, to your Page Layout or Master Page using SharePoint Designer.

<%@ Register Tagprefix="" TagName="" src=""  %>

8. Now add the control within the Master Page or Page Layout

<PublishingWebControls:RichHtmlField id="content" FieldName="PublishingPageContent" runat="server"/>
<TWA: id="" runat="server" />
<WebPartPages:WebPartZone id="wpzAfterContent" runat="server" title="Content" PartChromeType="None">

Done !




From http://www.sharepointblogs.com/sezai/archive/2006/09/04/11847.aspx

posted on 2006-09-04 16:42  有些伤感  阅读(582)  评论(0编辑  收藏  举报