Wednesday, April 24, 2013

SharePoint 2010 Search and Anonymous users


SharePoint search and anonymous users

 When anonymous users try to search something they get a user prompt. To get pass this prompt you must enter valid username, otherwise you’ll get “Access Denied”.
Solution:


Navigate to below path and open osssearchresults.aspx page

C:\Program Files\Common Files\Microsoft Shared\Web Server\Extensions\14\TEMPLATE\LAYOUTS\osssearchresults.aspx

Always have a backup of this file before modifying it. We just need to remove DynamicMasterPageFile
And Inherits attributes.

Change the page directive from

<%@ Page Language="C#"  DynamicMasterPageFile="~masterurl/default.master" Inherits="Microsoft.Office.Server.Search.Internal.UI.OssSearchResults"   EnableViewState="false" EnableViewStateMac="false"    %>


to

<%@ Page Language="C#" MasterPageFile="/_layouts/v4.master" EnableViewState="false" EnableViewStateMac="false"    %>

You can give any master page which is located under layouts folder. Otherwise you will get error like
(Error parsing attribute 'dynamicmasterpagefile': Type 'System.Web.UI.Page' does not have a public property named 'dynamicmasterpagefile'.)

That’s it. You search will work now. For safer side just reset  IIS server.

No comments:

Post a Comment

Followers