Skip to main content

Posts

CSOM Example

Once I was asked to develop a solution that was not to be installed on the SharePoint server neither I was allowed to create a webpart solution that could be deployed on SharePoint server. The best solution that I found was to create Desktop Application, and delivering it executable file. As it was a desktop application we need to use CSOM. In this blog I will show you a basic code demo to interact with SharePoint server. Validate User 1.         When you are on same domain as SharePoint server and use windows credentials to login. using ( ClientContext ctx = new ClientContext (URL)) { } 2.        When you are in different domain or want to login as different user. using ( ClientContext ctx = new ClientContext (URL)) {   ctx.Credentials = new NetworkCredential (UserName,Password,Domain); } 3.   When you want to login as FBA User using ( ClientContext ctx = new ClientContext (...

SharePoint Search on a Specific SharePoint List/Library.

There are times when we need to perform search on specific SharePoint List/Library. One of the possible solution that I found was as below. Add a column to your SharePoint List/Library, I would suggest you to create a site column and add it to your SharePoint List/Library. This will allow you to all the same column to other List/libraries also. Now open central administrator > Application Management > Manage Service Applications > Search service Application > Content Sources. Start full crawl, this will get the created site column to the crawl. Once the crawl is completed, in the left pane you can see Metadata Properties, click it. You will see below screen. Now click new managed property. Below screen will be loaded. Enter property name and click on Add mapping. This will open below screen. Find the site column crawled property that you created and map it with the name. That’s it your Meta property is now mapped with your crawled property...