Blog Home  Home Feed your aggregator (RSS 2.0)  
Kiruthik .com - Sharepoint2010
eCCentric Vagabond
 

A Web Part or Web Form Control on this Page cannot be displayed or imported. You don't have Add and Customize Pages permissions required to perform this action



A Web Part or Web Form Control on this Page cannot be displayed or imported. You don't have Add and Customize Pages permissions required to perform this action

This error occurs in Sharepoint 2010 or when you upgrade to Sharepoint 2010 from MOSS 2007. It clearly says, adding a webpart/webcontrol to this page is not possible, since the user who adds doesnt have Add / Customise Page permission.

Solution :

(a) Fix for that User alone
Add the below permission to the user / group.



(b) Fix for the webpart(s) for any user
Check which webpart created this error. The commonly/mostly used Content Editor Webpart is the culprit for us. So added the below entry in the  web.config. If its other webpart, add Assembly, Namespace and TypeName accordingly.






Before going for the fix, lets see why this was working in MOSS 2007 and not in Sharepoint 2010. or  what is broken when you upgrade to Sharepoint 2010 ??

Well, nothing is broken. Its just Sharepoint 2010 which was coded to have more granular security.
In the previous version(s) - MOSS 2007 (im not sure about 2003, but it also works the same i hope). My team mate was so eager to know the reason before fixing.


So, I checked the web.config of a MOSS 2007 web application and it had the above kind of entry, but for all webparts !!

ie., Type/TypeName = "*"  (any class in that assembly is registered as safe & AllowRemoteDesginer was true. )



Also, I tried using reflector and checked the two DLLS (MOSS 2007 - Microsoft.Sharepoint.dll  &  Sharepoint 2010 - Microsoft.Sharepoint.dll )

Where I found few methods like below defined in 2007 DLL is not  present in 2010 DLL.





Simply to put up, for granular control instead of having TypeName= "*" - we have each and every webpart defined in the safecontrol !


Tuesday, October 05, 2010 9:08:08 PM UTC  #    Comments [1]   Sharepoint - MOSS 2007 | Sharepoint 2010  | 
List throttling in sharepoint 2010 on   Tuesday, September 14, 2010

List throttling

List throttling is one of the new options in SharePoint 2010 that enable to set limits on how severely users can put the beat down on your servers. In a nutshell, what it does is allow you to set a limit for how many rows of data can be retrieved for a list or library at any one time. The most basic example of this would be if you had a list with thousands of items, and someone created a view that would return all of the items in the list in a single page. List throttling ensures that such a request would not be allowed to execute. The hit on the server is alleviated, and the user gets a nice little message that says sorry, we can’t retrieve all of the data you requested because it exceeds the throttle limit for this list.

These kinds of operations that can trigger hitting this limit though aren’t limited to viewing data – that’s just the easiest example to demonstrate. There are other actions that can impact a large number of rows whose execution would fall into the list throttle limits. For example, suppose you had a list with 6000 items and a throttle limit of 5000. You create a view that only displays 50 items at a time, but it does a sort on a non-indexed column. Behind the scenes, this means that we need to sort all 6000 items and then fetch the first 50. If you are going to delete a web with large flat lists you potentially have the same problem. We need to select all of the items for all of the lists as part of the site deletion, so we could again hit the throttling limit. These are just a few examples but you can start to imagine some of the others.

For code and samples check MSDN.
Tuesday, September 14, 2010 5:54:50 PM UTC  #    Comments [1]   .Net | Sharepoint | Sharepoint 2010  | 

Inheritable String Property

 

InheritableStringProperty  is a class available in Sharepoint 2007 Publishing Web. It extends from InheritableProperty<T> - but I think we need InheritableProperty in C#

using (SPSite site1 = new SPSite("http://home.kir:2306/"))
{
   PublishingWeb currentPublishingWeb = PublishingWeb.GetPublishingWeb(site.RootWeb);
   if (currentPublishingWeb != null)
   {
      InheritableStringProperty customMasterUrlProperty = currentPublishingWeb.CustomMasterUrl;
      customMasterUrlProperty.SetValue("/_catalogs/masterpage/new.master", true);   

   }
}

 

 

Monday, August 10, 2009 6:34:47 PM UTC  #    Comments [0]   .Net | C# | Sharepoint | Sharepoint - MOSS 2007 | Sharepoint 2010  | 
Copyright © 2012 Kiruthik Nandhakumar. All rights reserved.