SPWeb.GetFileAsString(URL) causing the problem, and throws COMException, if an XML file size is more than 10 MB

PROBLEM : SPWeb.GetFileAsString(URL) method throws COMException, if we pass XML file and its size is more than 10 MB WORK AROUND : Instead of using SPWeb.GetFileAsString(URL), use SPFile.OpenBinary() method. try {string str = Url.Text;using (SPSite portalSite = new SPSite(str)){SPWeb web = portalSite.OpenWeb();SPFile file = web.GetFile(str);byte[] content = file.OpenBinary();System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();string str1 = enc.GetString(content);//string…

3

Alternate Header configured in onet.xml causes problem in reqacc.aspx page.

When you configure the alternate header in onet.xml and it has dynamic content then the unauthorized user may not able to access reqacc.aspx page.   One of the most common requirement is having a common header in all the SharePoint site pages. SharePoint allows to configure ONET.XML to achieve the common alternate header for every page…

13