Category Archives: SharePoint

Search query to find pages in current site and all sub-sites [SharePoint]

I was given a challenge to develop a mechanism to list all pages in the current site and its sub-sites. Why not do it using Content By Search Web Part was my initial thought. In the end I managed to achieve this, … Continue reading

Posted in Search, SharePoint | 1 Comment

‘An unexpected error has occurred’ when cancelling from creating a new page [SharePoint]

On SharePoint 2013 we had an issue where the user was getting the error message below when cancelling from creating a new page in the Pages library. Sorry, something went wrong An unexpected error has occurred. The correlation ID for this … Continue reading

Posted in SharePoint | Leave a comment

“Input string was not in a correct format” error with People Picker and custom claim provider

In SharePoint 2013 I implemented a custom claim provider with search and resolve functionality and everything appeared to work fine. I was able to search and resolve users, grant them permissions to the site, and they were able to login … Continue reading

Posted in Claim Authentication, People Picker, SharePoint | 4 Comments

Enable/disable anonymous access for selected pages in SharePoint

It is well known that you can enable anonymous access in SharePoint at the site or list/library level. But what about enabling/disabling anonymous access to selected pages within the site? The problem is you can only have one Pages library … Continue reading

Posted in Permission, SharePoint | Leave a comment

Cancel button of ButtonSection does not return to previous page (SharePoint)

In SharePoint you can leverage OOTB controls to create professional and OOTB-looking pages. For example, below is a custom setting page that I have deployed to Central Admin. This page uses the OOTB InputFormSection and ButtonSection controls, as well as a few … Continue reading

Posted in SharePoint, SharePoint 2010, SharePoint 2013 | Leave a comment

How to update SharePoint web.config for ASP.NET ReportViewer control

If you have been trying to use the ASP.NET ReportViewer control in your SharePoint project then you may have found that you need to make several changes to the web.config, including: Remove the existing ReportViewerMessages appSettings Remove the existing ReportViewerWebControl handler Add … Continue reading

Posted in Report Viewer, SharePoint | Leave a comment

How to add links with query string to Quick Links/Current Navigation using code

In SharePoint 2010 you will find that you can add links with query string to Quick Links (aka Current Navigation) using the UI without any issue. If you enter something like http://mySite/pages/myPage.aspx?key=abc into the dialog, then it’d happily accept it. … Continue reading

Posted in SharePoint | 1 Comment

Connecting to SQL from SharePoint with claims based authentication and integrated security

Recently I had to retrieve data from SQL Server and display in a SharePoint portal. Data security trimming was implemented in SQL, which means I needed to connect to SQL using the current user’s identity. ASP.NET impersonation is enabled by … Continue reading

Posted in Claim Authentication, SharePoint | Leave a comment