1 把UserControl如:UCCommentPart.ascx,放到如下路径下
C:/Program Files/Common Files/Microsoft Shared/web server extensions/12/TEMPLATE/CONTROLTEMPLATES
2 在布局页面中头中
<%@ Register src="/_controltemplates/UCCommentPart.ascx" tagname="UCCommentPart" tagprefix="uc2" %>
相应位置添加UserControl即可。
<div>
<uc2:UCCommentPart ID="UCCommentPart1" runat="server" />
</div>
3 注意,不能放在wpresources目录下。如:
C:/Inetpub/wwwroot/wss/VirtualDirectories/10001/wpresources
在布局页面“文章页面中”添加,自定义UserControl
最新推荐文章于 2019-01-27 16:39:10 发布