This is Chaitu Madala's TypePad Profile.
Join TypePad and start following Chaitu Madala's activity
Join Now!
Already a member? Sign In
Chaitu Madala
Washington DC, USA
SharePoint Architect at Ironworks Consulting
Recent Activity
What? How to display source site title in Content Query Web Part and Search Results? Why? It is a not so uncommon requirement to group documents / list items by sites and display the site title for each group. Content Query Web Part returns lot of data but site title is not returned by it by default. SharePoint search service application does not come with property for site name or site title by default but luckily sharepoint search crawls and indexes site name as ows_sitename How? CQWP: In the .webpart file there is a property called ViewFieldsOverride. This property overrides... Continue reading
Image
What? How to fix SharePoint 2010 calendar's "Add" button issues after fixing the scrolling bug Why? Every SharePoint designer must have bumped across the scrolling issue with SharePoint 2010 master pages. Kyle Schaeffer & Greg Galipeau have already written excellent post 1 & excellent post 2 about this issue and how to fix it and so I am not going into details of the issue and how to fix it. Of course, with any solution that changes the core way a system works, there is bound to be issues. One such issue is with the OOB calendar web part's "Add"... Continue reading
Image
What? Incomplete SharePoint 2010 SPWebPartManager and its events that are never raised Why? The SPWebPartManager in SharePoint 2010 is incomplete. Some of its events are never raised and even if they are raised they don't work as expected. Recently I was working on a scenario where I had to restrict users from being able to add certain web parts to certain web part zones in the page. There is no such property in the web part zone that we can use to achieve this kind of functionality. However there are other useful properties that a web part zone offers such... Continue reading
Image
What? Is the user profiles service application configured correctly but people search not working? As you can see in the below screenshot, the user profile service is able to synchronize properly with AD and pull user profiles. When I searched for a user from a SharePoint site using people search results web part, no profiles were returned. I have also tried the query service web service (/_vti_bin/search.asmx) with no luck. Why? I realized that the user profile service application was created after the search service application was created and therefore the SPS3 protocol that SharePoint uses for reading profiles was... Continue reading
Image
What? SharePoint 2010 - How to Backup/Restore Managed Metadata from one farm/environment to another? Why? You will be amazed by the lack of proper import/export functionality. It is quite a general requirement to migrate Managed Metadata Service / Termsets from one environment to the other. There are a few approaches to backup/restore managed metadata between environments. OOB, SharePoint 2010 allows for ONLY importing managed metadata in CSV format. You are required to use Powershell / Object Model to build the csv file. Here is a script that can do it. Managed metadata terms and termsets each have a unique guid.... Continue reading
Image
WSPBuilder introduces a shortcut to attach the debugger to all the IIS worked processes. Continue reading
Slides from my SharePoint session given on August 12 2011 at SharePoint Saturday The Conference in Washington DC titled "Leverage Search and Customize to your Brand within SharePoint 2010" Continue reading
What? Today I spent some time trying to understand why a JavaScript function that I wrote to delete a cookie that was written by ASP.NET was not deleting it properly. I finally managed to find the reason and thought it might be useful to write about it as it might help someone.. What is so different about it? Just google / bing for "delete cookie using javascript" and you will see 100s of snippets to delete a cookie using javascript. In order to delete a cookie that was written by ASP.NET, we need to take a slightly different approach. How?... Continue reading
Scenario: You receive the below exception when you try to access Central Admin / any SharePoint site. Event ID from Event Log - 3 System.ServiceModel.ServiceActivationException: The service '/SecurityTokenServiceApplication/securitytoken.svc' cannot be activated due to an exception during compilation. The exception message is: Exception has been thrown by the target of an invocation.. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The farm is unavailable. at Microsoft.SharePoint.Administration.Claims.SPSecurityTokenServiceManager.get_Local() at Microsoft.SharePoint.IdentityModel.SPSecurityTokenServiceConfiguration..ctor() Resolution: Open IIS Go to Application Pools Find the security token application pool and click on "Advanced Settings" If you notice that the value for “enable 32-bit... Continue reading
Image
The Problem: We recently ran across an issue that prevented the SharePoint Server 2010 from starting with the below exception: "The search service is not able to connect to the machine that hosts the administration component" When I clicked on any link in the left navigation in search administration interface inside Central Administration, I was greeted with the below exception: The application pool in IIS that the search service uses is found in stopped state. It stops automatically as soon as it is started. Explanation: After hours of research, we have found that it was all happening due to an... Continue reading
Image
Scenario: SharePoint Designer throws the error "Server error: The URL is invalid, it may refer to a nonexistent file or folder or refer to a valid file that is not in the current Web" when you attempt to open/check-in/check-out/upload a file. Explanation: While there could be many reasons for this misleading error to show up, one of the reason is low disk space in the database server. I noticed that the transaction log file for the SharePoint_Config database, "SharePoint_Config_Log.LDF" (resides in \Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data in our case) has grown enormously to 28 GB which is approximately 70% of the... Continue reading
Image
Scenario: The SPSecurityTrimmedControl control in SharePoint is incomplete and buggy.Information about the bugs in this control are not provided by MSDN either. In this post, I will try to explain the bug in the SPSecurityTrimmedControl and a solution to get over it. Explanation: The SPSecurityTrimmedControl allows us to display/hide the content using a few different criteria, like authentication (for anonymous/authenticated users only), page mode (page in display or edit mode) or current user’s permissions. So what's wrong? The control doesn’t work the way you would expect it.It does a good job with displaying content based on permissions but fails to... Continue reading
Image
Scenario: Users get "Access Denied" over the whole site, despite having Full Control permission Site Collection Administrators have no problem logging in Explanation: A SharePoint 2010 site that uses claims-based authentication has been extended to Intranet zone that uses AD as well as FBA. The site has number of users in the default owners and members groups. All the site users always get access denied over the whole site even though they clearly have access to the site through the site groups. Site Collection Administrators are allowed to access the site and have no problems logging in. Resolution: Make sure... Continue reading
Image
Scenario: You receive the below exception when you try to logon to a site that has been configured to use Claims Based Authentication with a custom membership provider using FBA credentials: Event ID from Event Log - 8306 An exception occurred when trying to issue security token: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the... Continue reading
Scenario: No internet in domain controller Windows Server 2008 VM? How to fix troubles with internet access in a VM that is configured as a domain controller? Explanation: Installed SharePoint Foundation in a Windows Server 2008 Std VM. Before configuring the server as a domain controller, the VM had access to internet. Soon after configuring the VM as a domain controller, the server could not access internet from the host machine. Solution: After hours of troubleshooting, the below worked : Go to Control Panel\Network and Internet\Network and Sharing Center Click Local Network Connection: Click Properties: Highlight Internet Protocal Version 4... Continue reading
Scenario: No internet in domain controller Windows Server 2008 VM? How to fix troubles with internet access in a VM that is configured as a domain controller? Explanation: Installed SharePoint Foundation in a Windows Server 2008 Std VM. Before configuring the server as a domain controller, the VM had access... Continue reading
Posted Mar 27, 2011 at Chaitu Madala
Image
Scenario: How to use named optional parameters in PowerShell? Explanation: I always wondered whether it is possible to use named optional parameters in PowerShell scripts. The below script explains how to accomplish it. Solution: param([string]$SolutionPath = "", [string]$WebApp = "") The above line tells PowerShell to extract values from parameters "SolutionPath" and "WebApp". These values will be used in PowerShell with the same names ($SolutionPath and $WebApp) Lets save the below code into a ps1 file and name it "NamedParameters.ps1" #IMPORTANT - The below line should be the first line. There should be nothing before the below line. param([string]$SolutionPath =... Continue reading
Scenario: How to build a consumer web part in SharePoint 2010 using IWebPartParameters that works with HTML Form Web Part and Filter Web Parts? Explanation: The current SharePoint 2010 documentation still includes reference to an API interface which it says is obsolete. [ObsoleteAttribute( "Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead" )] public interface IFilterConsumer As we can see, the interface displays a message that says "Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead." Unfortunately, it's hard to find any good examples out there for writing a Web Part that uses the IWebPartParamters interface for consuming the HTML Form Web Part / Filter Web Parts. There is one brilliant example... Continue reading
Scenario: How to build a dynamic query for SPQuery object with multiple OR conditions programatically? Explanation: In this post, I will try to explain how to build a query for SPQuery object with multiple OR conditions dynamically. For example: If a programmer attempts to get list items from a list with IDs 1,2,5, 9 and 13 dynamically, he would need to build a query for SPQuery with multiple OR conditions. The below query seems to work at first glance but it does not work: <Query> <Where> <Or> <Eq> <FieldRef Name="ID" /> <Value Type="Counter">1</Value> </Eq> <Eq> <FieldRef Name="ID" /> <Value Type="Counter">2</Value>... Continue reading
Scenario: How to call SharePoint Web Services from the context of current logged-in user from an ASP.NET Web Site/Application that has Windows Authentication enabled? Explanation: SharePoint 2010/2007 exposes most of its Object Model through web services. SharePoint Web Services provide methods that you can use to work remotely with a deployment of SharePoint. A list of SharePoint 2010 web services can be found here A list of SharePoint 2007 web services can be found here Its not always a straight forward process to call SharePoint Web Services from the context of current logged in user from an ASP.NET Web Site/Application... Continue reading
Scenario: How to prevent controls inside an asp.net UpdatePanel from raising post backs (from within a custom control)? Explanation: Asp.net UpdatePanel is primarily used for performing asynchronous postbacks with partial page updates. After adding an UpdatePanel control to your page, you can achieve a partial-update of your page on a postback. Only the content in the UpdatePanel is refreshed, the other parts of the page remain unchanged. You may experience scenarios when controls that are placed inside an UpdatePanel of a custom web control cause the whole page to raise a post back. Resolution: Each control inside the update panel... Continue reading
Scenario: You receive an exception "The remote server returned an error: (401) Unauthorized." when you try to access a file in SharePoint Document Library. Explanation: When you try to access a document in a SharePoint site without anonymous access turned on in the below manner, you would receive a 401 unauthorized error. XmlDocument xDocument = new XmlDocument(); xDocument.Load(String.Format("{0}{1}", SPContext.Current.Web.Url, XmlFileLocation)); Resolution: Try to access the file as below: SPFile configFile = SPContext.Current.Web.GetFile(String.Format("{0}{1}", SPContext.Current.Web.Url, XmlFileLocation)); XmlDocument xDocument = new XmlDocument(); byte[] fileBytes = configFile.OpenBinary(); Stream streamFile = new MemoryStream(fileBytes); xDocument.Load(streamFile); Your code would access the file now. Continue reading
Scenario: How to estimate the storage space required for SharePoint 2010 content databases and index servers? Explanation: The following process describes how to approximately estimate the storage required for content databases, without considering log files: Calculate the expected number of documents. This value is referred to as D in the formula. How you calculate the number of documents will be determined by the features that you are using. For example, for My Site Web sites or collaboration sites, we recommend that you calculate the expected number of documents per user and multiply by the number of users. For records management... Continue reading
Image
Scenario: How to enable VariationLabelMenu control in SharePoint 2010? Explanation: SharePoint 2010 (and MOSS 2007) ships with a control called VariationLabelMenu that can be used on sites with site variations enabled. This control enables users to navigate to the related/equivalent pages in other language sites (for which the language packs are installed) Even though this control is provided OOB in SharePoint 2010, few steps need to be followed to get it to work. After everything has been configured correctly, you will see a nice little menu that looks like in the below picture. You can place it in the master... Continue reading
Questions: What is the difference between the fields PubDate and PublishedDate in a SharePoint Blog Post content type? How to display a SharePoint blog post's PublishedDate in Content Query Web Part ? Explanation: If you try to use Content Query Web Part hereafter referred to as CQWP to pull blog posts, you will notice that CQWP by default pulls the following fields: Modified Created PubDate It quite looks like the field "PubDate" refers to the date on which the blog post was published. But in fact the "PubDate" field is the same as the field "Modified" except that it returns... Continue reading
13