// Starting with ClientContext, the constructor requires a URL to the // server running SharePoint. ClientContext context = new ClientContext("http://SiteUrl"); // The SharePoint web at the URL. Web web = context.Web; // We want to retrieve the web's title and description. context.Load(web, w => w.Title, w => w.Description); // Execute the query to server. context.ExecuteQuery(); // Now, only the web's title and description are available. If you // try to print out other properties, the code will throw // an exception because other properties are not available. label1.Text = web.Title; label1.Text = web. Description;
Monday, February 9, 2015
Sharepoint CSOM Retrieve only selected properties of a website
Sharepoint CSOM Retrieve the title of a SharePoint website.
// Starting with ClientContext, the constructor requires a URL to the // server running SharePoint. ClientContext context = new ClientContext("http://SiteUrl"); // The SharePoint web at the URL. Web web = context.Web; // We want to retrieve the web's properties. context.Load(web); // Execute the query to the server. context.ExecuteQuery(); // Now, the web's properties are available and we could display // web properties, such as title. label1.Text = web.Title;
Basic operations with the SharePoint .NET client object model
When you create an App for SharePoint 2013 project in Visual Studio 2012, references to the .NET Framework assemblies,Microsoft.SharePoint.Client.Runtime.dll and Microsoft.SharePoint.Client.dll, are automatically added to the project.
The files are located on any SharePoint 2013 server at %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\ISAPI.
The files are located on any SharePoint 2013 server at %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\ISAPI.
SharePoint client APIs
You can use the SharePoint client object model (CSOM) to retrieve, update, and manage data in SharePoint 2013. SharePoint 2013 makes the CSOM available in several forms.
- .NET Framework redistributable assemblies
- JavaScript library
- REST/OData endpoints
- Windows Phone assemblies
- Silverlight redistributable assemblies
JavaScript provides 8 mathematical constants that can be accessed with the Math object
Math.E; // returns Euler's numberMath.PI // returns PIMath.SQRT2 // returns the square root of 2Math.SQRT1_2 // returns the square root of 1/2Math.LN2 // returns the natural logarithm of 2Math.LN10 // returns the natural logarithm of 10Math.LOG2E // returns base 2 logarithm of EMath.LOG10E // returns base 10 logarithm of E
Thursday, February 5, 2015
asp.net serialized object in json
//Group data
var lstGroupedPMs = (from lstPMItem in lstPMItemsDetails
group lstPMItem by lstPMItem.KRAType
into KRAMasterGroups
select new
{
KRAType = KRAMasterGroups.Key,
kraGroup = KRAMasterGroups,
templateName = performancetemplatedata.TemplateName,
positionID = performancetemplatedata.PositionID,
designation = performancetemplatedata.Designation
});
json = JsonConvert.SerializeObject(lstGroupedPMs, Newtonsoft.Json.Formatting.Indented);
jObject = JObject.Parse("{\"data\": " + json + "}");
var lstGroupedPMs = (from lstPMItem in lstPMItemsDetails
group lstPMItem by lstPMItem.KRAType
into KRAMasterGroups
select new
{
KRAType = KRAMasterGroups.Key,
kraGroup = KRAMasterGroups,
templateName = performancetemplatedata.TemplateName,
positionID = performancetemplatedata.PositionID,
designation = performancetemplatedata.Designation
});
json = JsonConvert.SerializeObject(lstGroupedPMs, Newtonsoft.Json.Formatting.Indented);
jObject = JObject.Parse("{\"data\": " + json + "}");
Subscribe to:
Posts (Atom)