Posts

Showing posts from June, 2011
My new blog present here.

Featured Post

Insights into Sitecore Search: A Definitive Introduction

A key component of digital experience management is effective information retrieval. A simplified approach is required for websites, applications, and platforms containing a lot of material so that consumers can easily get the data they require. This need is met by Sitecore, a well-known name in the field of digital experience platforms (DXPs), which provides powerful and comprehensive search functionality. We will travel into the realm of Sitecore Search in this article, learning about its capabilities, architecture , and the enormous value it offers both developers and end users. Introduction to Sitecore Search    A headless content discovery platform powered by AI , Sitecore Search enables you to build predictive and custom search experiences across various content sources. To extract and ...

Upload (Import) data from excel (spreadsheet) file to SharePoint list using c#

Upload (Import) data from excel (spreadsheet) file to SharePoint list using c#: When we have data in excel format and want to import that data to a SharePoint list, then how to do. By default SharePoint will provide us an option to edit in spreadsheet or download list items in spread sheet. But, it doesn't have an option to import the excel data to SharePoint list. To resolve this problem, I have created web part. In this web part, I am using SharePoint list called “Employee”. The name of columns are Tile and LastName. With the help of this web part, user will enter the data in the excel and then give the path of the file in the input box present in the page. Now instead of uploading the whole excel file into a document library the code will read the file and update the list with the data present in the excel file. The web part code is: using System; using System.Collections.Generic; using System.Text; using System.Web; using System.Data; using System.Xml; using System.Xml.Serializ...

Get changed user profiles in SharePoint using C#

Get all the user profiles/properties which are modified since yesterday date or any datetime interval: With the help of UserProfileManager class (Microsoft.Office.Server.UserProfiles), we can access properties of user profile and changed profile which are modified since yesterday date or any datetime interval. In this example we will access different components of UserProfileManager : using System; using System.Collections.Generic; using System.Text; using Microsoft.Office.Server; using Microsoft.Office.Server.Administration; using Microsoft.Office.Server.UserProfiles; using Microsoft.SharePoint; using System.Web; using System.Collections; namespace UserProfilesOMApp { class Program { static void Main(string[] args) { using (SPSite site = new SPSite("http://amitkumarmca04.blogspot.com")) { ServerContext context = ServerContext.GetContext(site); UserProfileManager profileManager = ...

Accessing SharePoint Publishing site Navigation (Global Navigation bar) using C#

Accessing SharePoint Publishing site Navigation (Global Navigation bar) using C#: With the help of PublishingWeb class (Microsoft.SharePoint.Publishing), we can access different components of Published Web site like Pages document library, Published site navigation bar and etc. In this example we will access different components of Published site: using System; using System.Collections.Generic; using System.Text; using Microsoft.Office.Server; using Microsoft.Office.Server.Administration; using Microsoft.Office.Server.UserProfiles; using Microsoft.SharePoint; using System.Web; using Microsoft.SharePoint.Navigation; using Microsoft.SharePoint.Publishing; namespace GetPublishedData { class Program { static void Main(string[] args) { using (SPSite site = new SPSite("http://amitkumarmca04.blogspot.com/")) { using (SPWeb web = site.RootWeb) { PublishingWeb publishingWeb = Publishing...

Accessing SharePoint Quick Launch menu (SPNavigation.QuickLaunch) using C#:

Accessing SharePoint Quick Launch menu (SPNavigation.QuickLaunch) using C#: With the help of SPNavigation, we will be able to access the Quick Launch menu of SharePoint site. Sometimes we need to show/hide Quick Launch menu item, so with the help of SPNavigation. QuickLaunch, we can loop through Quick Launch menu item. In this example we will access Quick Launch menu: using System; using System.Collections.Generic; using System.Text; using Microsoft.Office.Server; using Microsoft.Office.Server.Administration; using Microsoft.Office.Server.UserProfiles; using Microsoft.SharePoint; using System.Web; using Microsoft.SharePoint.Navigation; namespace GetQuickLaunch { class Program { static void Main(string[] args) { using (SPSite site = new SPSite("http://amitkumarmca04.blogspot.com/")) { using (SPWeb web = site.OpenWeb()) { SPNavigationNodeCollection qlNodes = web.Navigation.Quic...

SharePoint web parts properties validation

SharePoint web parts properties validation Sometimes, in a custom web part we define the custom properties. It’s very difficult to validate properties every time by opening the web part in edit mode. So we needed to include validations on it so that whenever the user clicked OK or Apply the error message should be shown so that the correct input should be given. Solution 1 : Earlier definition of the Property private string _amitKumar=String.Empty; public string AmitKumar { get {return _amitKumar;} set {_amitKumar = value;} } Updated web part property definition, private string _amitKumar =String.Empty; public string AmitKumar { get {return _amitKumar;} set { If(String.IsNullOrEmpty(value) { throw new Exception (“Value is required”); } else _amitKumar =value; } } The above approach works perfectly fine and will not let you close the properties pane until you provide the value in the _amitKumar field, you will keep g...