Month: August 2012

Sharepoint XSLT Transform Issue

While creating custom form of a list if you have encountered given exception.

Error while executing web part: System.StackOverflowException: Operation caused a stack overflow.
at Microsoft.Xslt.NativeMethod.CheckForSufficientStack()
at (XmlQueryRuntime , XPathNavigator , Double , String )
at (XmlQueryRuntime , IList`1 )
at (XmlQueryRuntime , XPathNavigator )
at Root(XmlQueryRuntime )
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results)
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.ExecuteTransform(XslCompiledTransform xslCompiledTransform, XsltArgumentList xmlArguments, Boolean bDeferExecuteTransform)
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)

in which some time Edit form opens and some time it doesn’t then most probably the issue with your form is too heavy for SharePoint to handle i.e contains a whole lot of fields (here whole lot of can be 50 and above)¬†ūüôā and it is taking more than one second to transform the XSLT.

The best chance you have to avoide this exception is to clean up XSL in the form or remove the controls that take more time to render (like BDC).

To clean up the XSL
1. You can remove the description part of SharePoint controls from your form. It will reduce whole lot of XSLT that you are not using and make your form render faster.
                          The description tag looks something like :
 

2. Remove the unnecessary datafields sharepoint is fetching and that are not used in the form (be very careful here )

NOTE: If you are getting same exception and form never renders then the reason could also be that you have messed up XSLT at someplace and its stuck. Eg. You have copied and pasted a control some where on page and both controls have same ID like id=”ff9{$Pos}”.

In this case try to recall what changes you made in the page and act accordingly.

Sharepoint 2010 Site Action Menu not working in IE 8/ IE 9 : Permanemt Fix

In March I wrote a post for enabling Site Menu when it is not working in IE 8/9.
That was not a permanent fix and I forgot to update that post with the Permanent Fix.1. Understanding the Issue.The issue we were facing was because the document mode in which IE was rendering the Page was different from the browser mode.2. Fix

Force IE to render in the desired mode. (Same thing we did in previous post, but this time using a meta tag)

To fix this issue :
1.  Edit Master page of your sharepoint site using Sharepoint Designer
2. Find ‘HEAD’ tag ()
3. Add given meta tag just below head tag

This will force IE to open in IE 9 mode. If you have IE 8 as your default document Type then change it accordingly.

For more information on http-equiv attribute you can go through give Hyperlink.

http://msdn.microsoft.com/en-us/library/ie/ms533876(v=vs.85).aspx