• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

How to Add ASP.NET User Controls To Master Pages or Page Layouts

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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 >

Done !




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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
ASP.NET Core 介绍和项目解读发布时间:2022-07-10
下一篇:
ASP.NETWebApi项目框架搭建(7):权限验证发布时间:2022-07-10
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap