“SPUrl” SharePoint Foundation 2010 中的前缀
我正在使用 SharePoint Foundation 2010。 有一个母版页v4.master。我想向 head 添加一些控件:
<head>
...
<SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/Style Library/demo.css%>" runat="server"/>
...
</head>
然后向 web.config 添加下一个代码:
<compilation batch="false" debug="false">
...
<expressionBuilders>
...
<add expressionPrefix="SPUrl" type="Microsoft.SharePoint.Publishing.WebControls.SPUrlExpressionBuilder, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>
</expressionBuilders>
</compilation>
但是没有程序集 Microsoft.SharePoint.Publishing.dll< /strong> 位于 GAC 或 C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14 中。如何将“SPUrl”包含到 web.config 中?
I am using SharePoint Foundation 2010.
There is a master page v4.master. I want to add some control to the head:
<head>
...
<SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/Style Library/demo.css%>" runat="server"/>
...
</head>
and then next code to the web.config:
<compilation batch="false" debug="false">
...
<expressionBuilders>
...
<add expressionPrefix="SPUrl" type="Microsoft.SharePoint.Publishing.WebControls.SPUrlExpressionBuilder, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>
</expressionBuilders>
</compilation>
But there is not assembly Microsoft.SharePoint.Publishing.dll in GAC or C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14. How I can include 'SPUrl' to the web.config?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用相对路径而不是使用绝对路径。你不想为了像 css 文件这样简单的东西而编辑你的 web.config...
use a relative path instead of using an absolute path. You dont want to edit your web.config for something simple as a css file...
答案是这样的:
http://www.wictorwilen.se /Post/Creating-custom-themable-CSS-files-for-SharePoint-2010.aspx
http://www.wictorwilen.se/Post/What-is-new-with-the-CssRegistration-control-in-SharePoint-2010.aspx
There is the answer:
http://www.wictorwilen.se/Post/Creating-custom-themable-CSS-files-for-SharePoint-2010.aspx
http://www.wictorwilen.se/Post/What-is-new-with-the-CssRegistration-control-in-SharePoint-2010.aspx