Pages

Mar 6, 2012

SharePoint Error: Code blocks are not allowed in this file


Problem

Users report the following error when attempting to access a document library in SharePoint.
An error occurred during the processing of /site/SharedDocuments/Forms/AllItems.aspx. Code blocks are not allowed in this file.
image

Explanation

Ever so often I have clients contact me with a SharePoint library fully corrupted reporting an error such as “Code blocks are not allowed in this file”.  The error is, in fact, limited to a specific view but it’s usually the default view, therefore the error makes the library appear like it is completely inaccessible.  The root cause of the error is simple – a user replaced a view file from the /forms/ folder of the document library, typically “AllItems.aspx” such as the screenshot below suggests.  Typically this occurs when the user is using explorer view but I’ve heard of manifest presentations of this error as well.

Solution – Option 1

1) Open site that contains the library
2) Click on “Site Actions” >> “Site Settings” to view the site settings page “_layouts/settings.aspx”
3) Click on the library that displays the error to view the library’s settings page
image
4) Add a new view to the library and check the box “default view”

Mar 5, 2012

What is the meaning of “Limited Access” in SharePoint?


SharePoint provides different levels of permissions, from the “Full Access” to “Limited Access”. Last one is not documented clearly and designed to cover some side-effects of item’s hierarchy.
Cite from “Permission levels and permissions” article:
The Limited Access permission level is designed to be combined with fine-grained permissions to give users access to a specific list, document library, item, or document, without giving them access to the entire site. However, to access a list or library, for example, a user must have permission to open the parent Web site and read shared data such as the theme and navigation bars of the Web site. The Limited Access permission level cannot be customized or deleted
"Limited Access" allows no direct access to site content at all, but is intended to allow users to traverse the site in order to access the items within it that they have explicit permissions to see.
For example, the user might have access only to one page of a site, but still need access to style sheets and other supporting site infrastructure in order to view it. In that case the user would need "Limited Access" permissions on the site and "Restricted Access" to the page.

One solution which i feel useful but I haven’t used in any of my project can be found on codeplex here:http://www.codeplex.com/SPLimitedAccessDisco
So you guys can try out..........................!

WCF Issue related to KB976769v2

Today we have seen a strange issue in consuming WCF service for our user control. The following error have been came up after turning off the Custom Errors in Web.Config file of SharePoint Web application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: An error occurred creating the configuration section handler for system.serviceModel/bindings: Could not load type 'System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement' from assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Source Error: 
Line 131:  </behaviors>
Line 132:
Line 133:  <bindings>
Line 134:   <wsHttpBinding>
Line 135:    <binding name="MyWSHttpBinding" maxReceivedMessageSize="2147483647">
My Environment Details:
  • SharePoint 2007
  • Windows Server 2003
Solution

After removing KB976769v2 from "Add-Remove programs" from control panel in all my web-servers fixed the problem.

Mar 1, 2012

Access denied error while Editing List Items in SharePoint(MOSS 2007)

Sometimes, we get access denied error while editing (Edit properties) the list item even though we have access to the Sharepoint list.
Also, View History link on the Sharepoint list item throws access denied issue

Solution
This is a issue with Sharepoint and we need to execute the code to the SP libraries or lists to fix the problem. The source code for this app is as follows. Put this in a console app and pass the site URL and list name as parameters.
This is working code and solved our production issue.

string RenderXMLPattenAttribute = "RenderXMLUsingPattern";
string weburl = "http://Pravyns/sites/Test/";
string listName = "Test Library";
SPSite site = new SPSite(weburl);
SPWeb web = site.OpenWeb();
Console.WriteLine(web.Name);
SPList list = web.Lists[listName];
SPField f = list.Fields.GetFieldByInternalName("PermMask");
string s = f.SchemaXml;
Console.WriteLine("schemaXml before: " + s);
XmlDocument xd = new XmlDocument();
xd.LoadXml(s);
XmlElement xe = xd.DocumentElement;
if (xe.Attributes[RenderXMLPattenAttribute] == null)
{
XmlAttribute attr = xd.CreateAttribute(RenderXMLPattenAttribute);
attr.Value = "TRUE";
xe.Attributes.Append(attr);
}
string strXml = xe.OuterXml;
Console.WriteLine("schemaXml after: " + strXml);
f.SchemaXml = strXml;
Console.WriteLine("Process completed");
Console.ReadLine();

Feb 24, 2012

Microsoft SharePoint 15: A 2012 release target date.....

Here you go...........

http://www.zdnet.com/blog/microsoft/microsoft-sharepoint-15-a-2012-release-target-an-app-marketplace-and-more/12002

Feb 11, 2012

Where is Praveen?

Its been long to write entry here. Feeling good after moving to JDA, Hyderbad. Hoping to write more articles this year.

Dec 20, 2011

BeforeProperties/AfterProperties in Event Receivers – Tricky....!


These are the values of the properties in List events:
ListBeforePropertiesAfterPropertiesproperties.ListItem
ItemAddingNo ValueNo ValueNull
ItemAddedNo ValueNo ValueNew Value
ItemUpdatingOriginal ValueChanged ValueOriginal Value
ItemUpdatedOriginal ValueChanged ValueChanged Value
ItemDeletingNo ValueNo ValueOriginal Value
ItemDeletedNo ValueNo ValueNull
And here are the properties available in Library events:
LibraryBeforePropertiesAfterPropertiesproperties.ListItem
ItemAddingNo ValueNo ValueNull
ItemAddedNo ValueNo ValueNew Value
ItemUpdatingOriginal ValueChanged ValueOriginal Value
ItemUpdatedOriginal ValueChanged ValueChanged Value
ItemDeletingNo ValueNo ValueOriginal Value
ItemDeletedNo ValueNo ValueNull
Hope this helps! :-)