Skip to main content


Showing posts from 2013

Extension methode for web.AllowUnsafeUpdates

How we do it:

using (SPSite site = newSPSite(SPContext.Current.Site.Url)) { using (SPWeb web = site.OpenWeb()) { web.AllowUnsafeUpdates = true; SPList list = web.Lists.TryGetList("TestExtensionList"); SPListItem item = list.Items.Add(); item[SPBuiltInFieldId.Title] = TextBox1.Text.Trim(); item.Update(); web.AllowUnsafeUpdates = false; }
How we can do it:

using (SPSite site = newSPSite(SPContext.Current.Site.Url)) { using (SPWeb web = site.OpenWeb()) { web.DoUnsafeUpdate(delegate() { SPList list = web.Lists.TryGetList("TestExtensionList"); SPListItem item = list.Items.Add(); item[SPBuiltInFieldId.Title] = TextBox1.Text.Trim(); item.Update(); }); } }

SharePoint connected Web Part not showing connections option

Possible reasons include the following:
You are not browsing a web part in edit mode. To set connection with other web part, Page should be in edit mode.Web part connection not allowed in the Web Application. To enable web part connection follow below steps: 1)   Open the central administration
2)   Application management
3)   Web applications
4)   Manage web applications
5)   Select the web application for which you would like to enable the option
6)   On the top-Ribbon-You will find an option as ‘webpart security’
7)   Click on it and you will get one frame window which specifies ‘security for web pages
8)   Here you will find the option of Web part connections
9)   Select the option “Allows users to create connections between Web Parts”
1)Open the central administration 2)Application management 3)Web applications 4)Manage web applications 5)Select the web application for which you would like to enable the option 6)On the top-Ribbon-You will find an option as ‘webpart security’ 7)Click on it and y…

Could not find stored procedure 'sp_dboption' while installing SharePoint with SQL 2012

To make use of SQL 2012 with SharePoint 2010 server should have SharePoint Service Pack 1 installed.


You can go ahead with alter

Show SharePoint Error Page instead of Yellow ASP.Net error page

To show SharePoint errorpage do below changes in Web.Config file:



<customErrorsmode="On" />

To See Error message on Page itself do below changed in Web.Config file



<customErrorsmode="Off" />

File deployment to Site Assest or Style Library SharePoint

1. Add Empty Module to Solution
2. Create root folder inside empty module
3. Create Sub folders for JS, Images, CSS files.
4. Do File specific changes in Element.xml file

Sample Element.xml

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="">
  <Module Name="TestDeploy" Path="TestDeploy" Url="SiteAssets">
    <File  Url="BV/Sample.txt" Type="GhostableInLibrary"/>

Solution Snap Shot:-

Check dupliacte in list SharePoint ECMA Script : Client object model

Screen Shots:-


Application pool keeps stopping / Service Unavailable in SharePoint Site / 503 error in SharePoint Site

One cause for this issue can be change in password for account with which Application pool is running for changing the Managed account password follow below blog post: (Never change it from IIS directly) If this is not your case then it can be below issue: If you check the eventvwr logs you will see below entry in it: The Module DLL 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\isapi\owssvr.dll' could not be loaded due to a configuration problem. The current configuration only supports loading images built for a x86 processor architecture. Solution: 1.Open IIS by typing inetmgr in RUN. 2.Click on Application pools 3.Click on particular Application pool for your site 4.Right Click Advance settings 5.Set Enable 32-bit applications to false

Error While Adding/ Retracting SharePoint WSP

Error In PowerShell

Install-SPSolution : Admin SVC must be running in order to create deployment ti
mer job.

Error In Central Admin

The timer job for this operation has been created, but it will fail because the administrative service for this server is not enabled.


SharePoint DateTime control not loading for some user (DateTimeControl Access denied )

It is a permission issue. DateTimeControl field uses the iframe calender page to render the actual calender. The location of iframe.aspx is C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS The problem appeared to be with managed paths in the site collections, the Users with "Contribute access" were accessing the following path: http://myserver/_layouts/iframe.aspx (Path to Root site collection where user doesn't have access) The solution:

Why to Dispose SPSite and SPWeb objects in SharePoint?

Several of the SharePoint Foundation objects, primarily the SPSite class and SPWeb class objects, are created as managed objects. However, these objects use unmanaged code and memory to perform the majority of their work. The managed part of the object is much smaller than the unmanaged part. Because the smaller managed part does not put memory pressure on the garbage collector, the garbage collector does not release the object from memory in a timely manner. The object's use of a large amount of unmanaged memory can cause some of the unusual behaviors described earlier. Calling applications that work with IDisposable objects in SharePoint Foundation must dispose the objects when the applications finish using them. You should not rely on the garbage collector to release them from memory automatically.

Cleared MCPD 70-576 exam / Prepartion material and links for 70-576

I sat for 70-576 – PRO: Designing and Developing Microsoft SharePoint 2010 Applications exam last Saturday and it went very well. I cleared the exam with good score. Though score was less than my last certification exam 70-573 I was happy to earn the score of 830 after spending lot of month for preparing myself for exam and getting the required confidence and Knowledge.
I discovered lot of SharePoint areas which were in dark for me before exam preparation. The amount of knowledge I gain is huge. Hoping that I will get chance to implemented all my learning in some of the projects I do then only it will stay with me forever and I will never forgot.
How I prepared for the exam?
There is no specific book which will cover all syllabus required for exam (even I don’t like reading book from start to end, I get lost in them). So the best way was to know the syllabus and learn all topics one by one with Google search.
While searching for the topic and learning I was gathering all the links in Exce…