1. What is event receivers?

Event receivers allow responding to events as they occur within SharePoint, such as adding an item or deleting an item. They inherit from the SpItemEventReciever or SPListEventReciever base class

2. How to use an event receiver?

Event receivers respond to events, thus used for something as canceling an action, e.g. deleting a document library by using the Cancel property. This would prevent users from deleting any documents if you wanted to maintain the data.

3. Explain Difference between an asynchronous and synchronous event receivers?

An asynchronous event takes place after an action has taken place, and a synchronous event occurs before the action has take place.

4. What is .ddf file?

A .ddf file: Data Directive File. It contains the metadata like the source files and their destination locations. The .ddf file is passed as a parameter to the MAKECAB utility to orchestrate construction of the SharePoint solution file.

5. Explain SharePoint Solution File? How it differ from WebPart .cab files in legacy development? What does SharePoint Solution File contain?

A SharePoint solution file is compressed file that contains custom components. It is suffixed with a .wsp extension that aids in deployment.

Differences between the .cab and the SharePoint solution files are:

Solution files allow easy deployment to all Web Front End's.
Solution files are highly manageable from the interface.
Solution files can provide Code Access Security to avoid GAC deployments.

A solution file contains: aspx files, DLLs, resource files, definition files.

6. Explain ClassResources? How to reference and deploy resources with an ASP.NET 2.0 WebPart?

ClassResources are defined in the SharePoint solution file. It is a helpful directory to use in order to deploy custom images. In ASP.NET 2.0, objects (images) are referenced by embedding them as resources within an assembly. ClassResources allows us to eliminate recompiles to change small interface adjustments or alterations to external JavaScript files. Just saving the files can work.

7. Explain WebPart properties, and what are some of the attributes you see when declaring WebPart properties in code?

WebPart properties are just like ASP.NET control properties, they are used to specify the characteristics of a webpart and by specifying the attributes with the desired values by a user. Some of the attributes are WebDescription, WebDisplayName, Category, Personalizable, and WebBrowsable.

8. Explain impersonation, and when would you use impersonation?

Impersonation is the concept of providing functionality in the context of a different identity, for example letting a user access the system with anonymous access. You would use impersonation in order to access resources on behalf of the user with a different account, that normally, that would provide just the very basic rights to access the system.

9. What is CAML?

CAML: - Collaborative Application Markup Language.

It is an XML based language and provides data constructs used to build up the SharePoint fields and is also used for table definition. CAML is used to build or customize SharePoint based sites and construct a CAML query in a WebPart to retrieve values from a SharePoint List.

10. How to return SharePoint List items using SharePoint web services?

Create a reference to the SharePoint Lists.asmx web service by appending “/_vti_bin/Lists.asmx” to the end of a site name. One can use this url to add a service reference in Visual studio there onwards. This will query the WSDL for the Lists.asmx service.

Next step is to configure the security to be able to call the service methods. You can do this by altering the bindingConfiguration to indicate the transport uses NTLM authentication, which is the default.

We can then iterate through all the lists.

e.g:

ServiceReference1.ListsSoapClient proxy = new ServiceReference1.ListsSoapClient();

proxy.ClientCredentials.Windows.ClientCredential = new NetworkCredential();

XmlNode node = proxy.GetListCollection();

XPathNavigator nav = node.CreateNavigator();

XPathNodeIterator iter = nav.SelectDescendants("List", "http://schemas.microsoft.com/sharepoint/soap/", false);

while (iter.MoveNext())

{

string title = iter.Current.GetAttribute("Title", string.Empty);

string id = iter.Current.GetAttribute("ID", string.Empty);

Messagebox.Show ("title:" + title + “ and id:” + id);

}

writer.Flush();

Download Interview PDF