Skip to main content

Posts

Showing posts from December, 2010

Some Useful Links & Topics!!!

Windows Concepts ·         Windows NT Basics – http://technet.microsoft.com/en-us/library/cc768132.aspx ·         Disk and File System Basics – http://technet.microsoft.com/en-us/library/cc750198.aspx ·         Permissions for files and folders – http://technet.microsoft.com/en-us/library/cc787794(WS.10).aspx   Networking Concepts ·         OSI Layers – http://technet.microsoft.com/en-us/library/cc977633.aspx and http://support.microsoft.com/kb/103884 ·         Address Classes – http://technet.microsoft.com/en-us/library/cc940018.aspx ·         DNS – http://technet.microsoft.com/en-us/library/cc779489(WS.10).aspx ·         DHCP – http://technet.microsoft.com/en-us/library/cc780760(WS.10).aspx ...

SharePoint Elevated Privilege without RunWithElevatedPrivelege

ou may need to elevate privilege if the current user doesn't have permission to read that object from the SPSite. In this case, you'll need to elevate privilege just to get the user token, but we don't want to perform any operations inside RunWithElevatedPrivilege, we only want to get a token out (which is basically a simple byte array). You could also cache the system token in the application if you needed to. Best Practices for Elevated Privilege in SharePoint: Elevated Privilege can be used to bypass or work with security, and can be performed either through SPSecurity or through impersonation techniques involving the SPUserToken and the SPSite class. It's one of the most misunderstood aspects of the SharePoint API, but in general you should always prefer impersonation using the SPSite class and SPUserToken objects. Here's my list of best practices for elevated privilege code in SharePoint that will help you create more reliable applications for the enterprise....

Windows SharePoint Services Object Model,SharePoint 2010 Object Model

Identity : Microsoft.SharePoint Description : Windows SharePoint Services Path : To add a reference to a Sharepoint API, Right-click the project(in VS) and select Add   Reference. Click the Browse tab and select the following directory:        C:\program files\common files\microsoft shared\web server extensions\12\isapi Some useful Microsoft.SharePoint Namespaces follows with Description : Microsoft.SharePoint Provides types and members for working with a top-level site and its subsites or lists. Microsoft.SharePoint.Administration Provides administrative types and members for managing a Windows SharePoint Services deployment. Microsoft.SharePoint.Administration.Backup Provides types and members for performing backup and restore operations on SharePoint sites. Microsoft.SharePoint.Deployment Provides types and members for importing and exporting content between Windows SharePoint Services Web sites. Microsoft.SharePoint.Dsp Pr...

Sharepoint Webparts Workflows custom controls Questions

Q) How can we use custom controls in SharePoint? Step 1:- Create the custom control by inheriting from the ‘WebControl’ class and override the ‘RenderContents’ method with your implementation. In the below code snippet we are just writing the site title and site URL to the browser. using System.Web.UI; using System.Web.UI.WebControls; using Microsoft.SharePoint; namespace NameSpaceCustomControl {           public class CustomControl1 : WebControl           {                     protected override void RenderContents(HtmlTextWriter output)                    {                    SPWeb   rootSite = SPContext.Current.We...

Sharepoint Template ID Event Handlers

The following list template integer IDs that you can use in defining the template ID for event handlers. List Template Id               List Template 100                                          Generic list 101                                         Document library 102                                         Survey 103   ...

Sharepoint Programming interview Questions with Answers Part 2

Q) Write a program to fetch the Username To fetch the User name in Console application is as follows using Microsoft.SharePoint; namespace ConsoleApplication1 {     class Program     {         static void Main(string[] args)         {             SPSite rootSite = new SPSite(" http://pravahaminfo-pc:1534/ ");             SPWeb rootWeb=  rootSite.RootWeb;             SPUserCollection  userList =  rootWeb.AllUsers;             foreach (SPUser objUser in userList)             {                 Console.WriteLine(objUser...

Sharepoint Interview Questions with Answers

Q) Difference between MOSS and WSS WSS is foundation and MOSS is optional add-on. You cannot install MOSS of itself. If you try to do this, you will be requested to install WSS first. Characteristics of WSS It is a Web Based Application It stores all information in an MS SQL database. It displays information using web Parts. It comes with site templates. What WSS does not have? There is no support for indexing and Searching. It does not have advanced intranet features, such as targeted information and content management. It has no record management. It cannot display InfoPath forms in Web Browser. It cannot display MS Excel spreadsheet as Web Part. It comes with less than 10 Web parts. It cannot Read and Write to External Database. So to achieve all above task which WSS does not have, MOSS came into action. MOSS 2007 Use global search functionality to find any type of information regardless of type and location. Target information to one or more User Group. Use A...