We're Hiring!
Take the next step in your career and work on diverse technology projects with cross-functional teams.
LEARN MORE
Mountain West Farm Bureau Insurance
office workers empowered by business technology solutions
BLOG
6
23
2014

Issues with Search Results Page Layouts and SharePoint Designer

Last updated:
7.15.2021

Description

An issue was encountered in a SharePoint 2013 environment, where when attempting to create a new Search Results page through the SharePoint UI, an error would be generated and the page creation was unsuccessful.

If an existing Search Results page was copied and pasted into the same Pages library through SharePoint Designer, there were no issues and no error generated.

The result is that new Search Results pages could not be created for custom Result Sources or other formatting / data sourcing needs.

Prerequisites to Reproduce the Issues

To recreate the issue, the following may be needed:

Steps to Reproduce the Issue

Below are steps and details around recreating the issue in a standard environment:

  1. After a Publishing Portal with an Enterprise Search Center has been created, open the top-level site with SharePoint Designer. Learn more about sharepoint governance here in terms of SharePoint Design.
  2. Within Site Objects, navigate to All Files, then _catalogs, then masterpage
  3. Check out the file SearchResults.aspx, and open to Edit File in Advance Mode
  4. Note that the  and other Web Part tags have an element setting the __MarkupType to "vsattributemarkup":
  5. Now edit the page in a non-destructive way, such as placing a CSS comment in the PlaceHolderAdditionalPageHead section:
  6. Save the file within SharePoint Designer, and close the file
  7. Within SharePoint Designer, reopen the file
  8. Note that the  and other Web Part tags have the element of __MarkupType now set to "xmlmarkup", instead of the original value of "vsattributemarkup":
  9. Navigate to your Search Center site
  10. Navigate to the Pages library contained within the Search Center site
  11. Click File, New Document, and select Page
  12. Provide a Test title, and URL Name
  13. Under Page Layout, choose "(Welcome Page) Search results"
  14. Click Create
  15. You should receive an error page such as the following:
  16. If the Correlation ID is investigated in the SharePoint ULS logs, an error like the following will be found:

06/20/2014 13:54:15.72 w3wp.exe (0x3730) 0x0B10 SharePoint Foundation Web Parts 7935 Information https://www..com/_catalogs/masterpage/SearchResults.aspx - An unexpected error has been encountered in this Web Part. Error: Unknown server tag., DesignText:

Workaround

The currently identified workaround involves resetting file versions on the respective Page Layout file, for instance SearchResults.aspx. This apparently forces SharePoint to interrogate the file, and reset the __MarkupType field value to "vsattributemarkup".

  1. Navigate to the top-level site in the site collection, and click the Site Actions symbol, then Site Settings:
  2. Under Web Designer Galleries, click Master pages and page layouts
  3. Find the Page Layout file, in this example it is SearchResults.aspx; Then click Version History:
  4. Note what the current version of the file is, that has the latest changes; In this example it is version 8.0:
  5. Choose a previous version of the file, it doesn't really matter which, and click Restore
  6. Click OK on the prompt about replacing the current version
  7. Note that the latest file has been replaced with a new version, which contains old content:
  8. Now, on the file which contains the desired changes, click Restore; In this case it is version 8.0
  9. Click OK when prompted to replace
  10. There should now be an updated version that contains the desired changes:
  11. Publish the version as a major version; In this case the version number increases to 9.0
  12. To verify the __MarkupType element value has been reset, open the file in SharePoint Designer. *IMPORTANT: Do not save the file within SharePoint Designer again, only view
  13. Verify that the instances of __MarkupType have been reset to contain the value of "vsattributemarkup":
  14. As final verification, try creating a new Search Results page as outlined in the previous section; The steps to create a new Search Results page should now be successful, and not generate any errors
    *Note: Test both creating the new results page, as well as opening it in the browser

Additional Details

This issue was found in a client's environment who was using the following build version of SharePoint 2013:

062314_1435_IssueswithS19.png

It also appears others have encountered this issue with previous versions of SharePoint.

Recent Blog Posts

lunavi logo alternate white and yellow
9.25.2024
09
.
25
.
2024
Maximizing Business Efficiency with Azure DevOps

For enterprises looking to adopt or mature their DevOps practices, Azure DevOps offers unmatched flexibility, scalability, and depth.

Learn more
lunavi logo alternate white and yellow
9.9.2024
09
.
09
.
2024
Exploring Microsoft Fabric: A Comprehensive Overview

Discover how Microsoft Fabric transforms data management and analytics with powerful tools for real-time insights and seamless collaboration, driving smarter, faster business decisions.

Learn more
lunavi logo alternate white and yellow
9.5.2024
08
.
29
.
2024
Unlock the Future with Data & AI: Why Partnering with Lunavi Makes All the Difference

Learn about the Microsoft Data and AI designation, how Lunavi earned the designation and the power of Data and AI

Learn more