如何从 _layout SharePoint 页面使用网站的母版页?
我想在我的 SharePoint 12 hive/template/layouts/TelephoneBookList/test.aspx 文件中使用母版页文件(如果有意义的话,就是网站的母版页文件)。 但是,每当我将 MasterPageFile="~/_layouts/simple.master" 或类似内容添加到 test.aspx 页面时,我都会收到一个共享点错误页面,并在日志文件中看到以下内容:
01/12/2009 10:56: 26.95 w3wp.exe (0x1064) 0x1280 Windows SharePoint Services 拓扑 0 严重 无效 URL:http://localhost。 您可能还需要更新引用 http://mcdevsp 的任何备用访问映射。 有关此错误的帮助:http://go.microsoft.com/fwlink/?LinkId=114854
01/12/2009 10:56:27.09 w3wp.exe (0x1064) 0x1280 Windows SharePoint Services 常规 8dzz 高 异常类型:System.Web.HttpException 异常消息:文件 '/_layouts/TelephonebookList/~masterurl/default .master'不存在。
01/12/2009 10:56:27.23 w3wp.exe (0x1064) 0x1280 Windows SharePoint Services 拓扑 0 严重 无效 URL:http://localhost< /a>. 您可能还需要更新引用 http://mcdevsp 的任何备用访问映射。 有关此错误的帮助:http://go.microsoft.com/fwlink/?LinkId=114854
01/12/2009 10:56:27.70 w3wp.exe (0x1064) 0x1280 Windows SharePoint Services 常规 8dzw 中 spHttpHandler:GetHash 已启动
01/12/2009 10:56:27.70 w3wp.exe (0x1064) 0x1280 Windows SharePoint服务 General 8dzx Medium spHttpHandler:GetHash finish
没有 MasterPageFile 属性,它可以完美工作,但是它没有全局 Look & 功能。 网站的感觉。
非常感谢。
I want to use a masterpagefile (the site's one if this makes sense) in my SharePoint 12 hive/template/layouts/TelephoneBookList/test.aspx file. However, whenever I add MasterPageFile="~/_layouts/simple.master" or something like that to my test.aspx page, I get a sharepoint error page and the following in the log file:
01/12/2009 10:56:26.95 w3wp.exe (0x1064) 0x1280 Windows SharePoint Services Topology 0 Critical Invalid URL: http://localhost. You may also need to update any alternate access mappings referring to http://mcdevsp. Help on this error: http://go.microsoft.com/fwlink/?LinkId=114854
01/12/2009 10:56:27.09 w3wp.exe (0x1064) 0x1280 Windows SharePoint Services General 8dzz High Exception Type: System.Web.HttpException Exception Message: The file '/_layouts/TelephonebookList/~masterurl/default.master' does not exist.
01/12/2009 10:56:27.23 w3wp.exe (0x1064) 0x1280 Windows SharePoint Services Topology 0 Critical Invalid URL: http://localhost. You may also need to update any alternate access mappings referring to http://mcdevsp. Help on this error: http://go.microsoft.com/fwlink/?LinkId=114854
01/12/2009 10:56:27.70 w3wp.exe (0x1064) 0x1280 Windows SharePoint Services General 8dzw Medium spHttpHandler:GetHash started
01/12/2009 10:56:27.70 w3wp.exe (0x1064) 0x1280 Windows SharePoint Services General 8dzx Medium spHttpHandler:GetHash finished
Without the MasterPageFile attributes, it works perfectly, however it does not have the global Look & Feel of the web site.
Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SharePoint 要求使用 ~/_layouts/application.master 声明 _layouts 页面。 然后可以使用 OnPreInit 技术在运行时更改主设备。
HttpModule 可用于更改所有应用程序页面上的主控: 如何自定义 SharePoint application.master 文件
SharePoint requires _layouts pages to be declared with ~/_layouts/application.master. The OnPreInit technique can then be used to change the master at runtime.
An HttpModule can be used to change the master on all application pages: How to customise the SharePoint application.master file
试试这个:
将 MasterPageFile 声明保留为默认值 (~/_layouts/simple.master) 并覆盖自定义代码中的 OnPreInit。
Try this:
Leave the MasterPageFile declaration at it's default (~/_layouts/simple.master) and override OnPreInit in your custom code.