我正在尝试从Sharepoint designer 2013实现搜索功能。我关注此链接: http://spevilgenius.blogspot.in/2013/07/sharepoint-2013-custom-search-box.html
我通过编写以下代码在我的母版页标题中添加了搜索网页部分:
<SearchWC:SearchBoxScriptWebPart ID="EmployeeSearch" UseSiteCollectionSettings="false" InitialPrompt="Search..." ShowPeopleNameSuggestions="true" ResultsPageAddress="~sitecollection/_catalogs/masterpage/SearchResults.aspx" EmitStyleReference="false" ShowQuerySuggestions="true" ChromeType="None" UseSharedSettings="false" TryInplaceQuery="false" ServerInitialRender="true" runat="server" />
但是当我在搜索框中插入搜索文本并按Enter键时,会出现以下错误:
The base type 'Microsoft.Office.Server.Search.Internal.UI.SearchResultsLayoutPage' is not allowed for this page.
The type Microsoft.Office.Server.Search.Internal.UI.SearchResultsLayoutPage, Microsoft.Office.Server.Search, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c could not be found or it is not registered as safe.
搜索框工作正常,但是当我尝试在SearchResults页面中添加母版页时,它导致了上面提到的错误。我现在已经从SearchResults页面删除了母版页,但错误仍然存在。