Posts

How to use Jquery in Sharepoint 2010

Image
To use jQuery with SharePoint, there are two things that need to be done: The JavaScript library should first be deployed to a location which can be accessed by SharePoint pages, and the library should be loaded by the SharePoint pages. The recommended location for deployment of the JavaScript library is  C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS folder . Doing so will allow the file to be loaded via the URL http://pravaham123/_layouts/jquery.js , because the _layouts part of the URL always points to the LAYOUTS folder. There are a couple of ways you can do this. 1) Using the Content Editor Web Part to load your jQuery Library The simplest way to load the library is by adding a Content Editor Web Part to the page and adding the following script to its Source Editor in the tool pane: < script type ="text/javascript" src ="http://pravaham123/_layouts/jquery-1.5.2.min.js" > script ...

SharePoint Interview Questions II

1.Describe the potential components for both a single server, and multiple servers, potentially several tiered farms: A single-server SharePoint Server 2010 environment leverages a built-in SQL Server 2008 Express database. The problems with this environment is scalability, not being able to install the with built-in database on a domain controller, the database cannot be larger than 4 GB, and you cannot use User Profile Synchronization in a single server with built-in database installation. Multiple tier farms would be a three-tier topology, considered one of the more efficient physical and logical layouts to supports scaling out or scaling up and provides better distribution of services across the member servers of the farm. 2. How will you use Web Parts or other solutions Created in SharePoint 2007 in SharePoint 2010? In SharePoint 2010 the 12 hive is now replaced by 14 hive, So we will rewrite and recompile any code that refers to files and resources in “12 ″ hive. In additi...

SharePoint - Elevated Privileges

When developing using the SharePoint object model, certain operations has to be run with elevated privileges. For instance, setting information into the property bag of a site needs to be done with elevated privileges. This post shows how this is done, and also includes a helper method for making it easier and shorter to do this. There is a method called  SPSecurity.RunWithElevatedPrivileges  in the object model that takes a delegate as argument. The delegate is then run with more permissions. An important note regarding this: You must not use old references to  SPWeb  or  SPSite  instances inside your delegate, since they are “contaminated” with lower permissions. What you have to do is to create new  SPSite  and  SPWeb  instances using the Ids of the sites and webs you already have a reference to, like this SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(SPContext.Current.Site.ID)) ...

SharePoint Interview Questions I

Q. What has Changed in SharePoint 2010 Object model? Ans.   Microsoft has replaced the “12 hive” structure that we had in SharePoint 2007 with “14 Hive” structure in 2010. It has apparently added four new folders to its hive. The Folders are : * Policy * UserCode * WebClients * WebServices Q. How would you deploy WebPart Using Windows PowerShell? Ans.   At the Windows PowerShell command prompt (PS C:\>), type the below command : Install -SPWebPartPack -LiteralPath “FullPathofCabFile” -Name “Nameof WebPart” Q. How would you re-deploy the old custom solutions in SharePoint 2010.What Changes are needed to the old Solution files. Ans.   SharePoint 2010 object model contains many changes and enhancements, but our custom code will still compile and, will run as expected. You should however, rewrite and recompile any code that refers to files and resources in “12 hive”. For Details See : SharePoint Object Model – Backward Compatibility Q. How would you add a link in th...