Posts

Adding content type programatically

Scenario: You want to add Content Type programatically Solution: SharePoint Object Model Code: using  (SPSite site =  new  SPSite( "http://localhost" )) {       using  (SPWeb web = site.OpenWeb()) {       SPContentType baseType = web.AvailableContentTypes[ "Document" ];       SPContentType proposal =  new  SPContentType( baseType, web.ContentTypes,  "Project Proposal" );       proposal.FieldLinks.Add( new  SPFieldLink(web.AvailableFields[ "Author" ]));       web.ContentTypes.Add(proposal);       }   }  

Public Token key for the assembly

Scenario: Sharepoint require most of the assemblies to be strongly named and referenced using 4 part name of the assembly. Solution: You can use sn.exe utility to get the public token key for your assembly Code:      "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\sn.exe"  -T MyAssembly.dll   or           "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe"  -T MyAssembly.dll  

Increasing Site Template maximum size limit

Scenario:    You are not able to save a site template (.stp ) file because its size is bigger than 10MB. Solution:     STSADM allow you to change it. Code:     stsadm -o setproperty -pn max-template-document-size -pv 40000000  

SharePoint Development and Programming FAQ

http://social.msdn.microsoft.com/forums/en-US/sharepointdevelopment/thread/5834679b-482b-4924-b881-fa2146840d05

SharePoint Job – SPJobLockType – which one should you use ?

Please refer the following blog http://manomangaldas.blogspot.com/search?updated-min=2011-01-01T00%3A00%3A00-08%3A00&updated-max=2012-01-01T00%3A00%3A00-08%3A00&max-results=1

SharePoint Interview Questions

Please refer this blog http://manomangaldas.blogspot.com/search/label/Interview http://manomangaldas.blogspot.com/search?updated-min=2010-01-01T00%3A00%3A00-08%3A00&updated-max=2011-01-01T00%3A00%3A00-08%3A00&max-results=6

Add a custom menu in List Toolbar

Image
Using a Feature XML file, you can add a custom menu in a List Toolbar. The following image is a sample of the custom feature. There are couple of steps to create the List custom menu bar. Create a XML file, give a name to this file, e.g. "Test.xml". Add a "CustomAction " XML Element in this file. Add following attributes to this element: " RegistrationType="List" RegistrationId="100" Location="ViewToolbar" Sequence="1000" Title="Submit to Manager" Description="Custom List Action" Reference "Test.xml" file in "feature.xml"file using "ElementManifest Location='Test.xml' " XML schema. Install and activate this feature. Create a custom list from the site. You will see the custom menu "Submit to Manager" displaying on the List Toolbar.