<div id="dvResult">Loading...</div>
<script>
var data = [
{"firstName":"Michael","lastName":"Jackson","SSN":"123456789"},
{"firstName":"Barack","Obama":"Smith","SSN":"124456789"},
{"firstName":"Peter","lastName":"Jackson","SSN":"125456789"}
];
var x = '';
for (i = 0; i < data.length; i++)
{
x = x + data[i].firstName + " " + data[i].lastName + " " + data[i].SSN + "<br/>";
}
document.getElementById("dvResult").innerHTML = x;
</script>
Thursday, October 2, 2014
Real Quick JSON Example
JSON is better to handle than XML. Was using it in a project so thought to post here,
Bulk Site Collection Deletion using PowerShell
Description:
Following powershell reads the list of site collections from the file and deleted them:
Following powershell reads the list of site collections from the file and deleted them:
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
function WriteLog
{
Param([string]$message, [string]$logFilePath)
Add-Content -Path $logFilePath -Value $message
}
$LogFile = "G:\DeletedSites.log"
$ListFile = "G:\List.csv"
$Sites = Import-CSV $ListFile
ForEach ($S in $Sites)
{
try
{
$URL = $S.URL
$Now = [System.DateTime]::Now
$MSG = $Now.ToString() + " | Deleting site: " + $URL
write-host $MSG
WriteLog $MSG $LogFile
Remove-SPSite -Identity $URL -GradualDelete -Confirm:$false
}
catch [system.exception]
{
$Now = [System.DateTime]::Now
$MSG = $Now.ToString() + "Exp: " + $_.Exception.Message
write-host -f red $MSG
WriteLog $MSG $LogFile
}
$Site = $Null
}
write-host "Done."
Wednesday, October 1, 2014
Get Claims Programmatically
And that's how you get all the claims for a user programmatically in .NET. Almost similar to my older post:
public void GetClaims()
{
System.Security.Principal.IPrincipal ipl = System.Web.HttpContext.Current.User;
System.Security.Claims.ClaimsIdentity claimsIdentity = (System.Security.Claims.ClaimsIdentity)ipl.Identity;
foreach (System.Security.Claims.Claim oClaim in claimsIdentity.Claims)
{
Response.Write("ClaimType [" + oClaim.Type.ToLower() + "] has value [" + oClaim.Value + "]");
}
}
Get Query String from JavaScript
I use this javascript function in every other project and every time I have to go to the internet and search for it. I am just too lazy to look and copy it from the old projects. So I am copying it from the internet to save it in my personal source code repository.
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
var strValue = getParameterByName('Value');
document.write(strValue);
Monday, September 22, 2014
Sharepoint 2013 Training
I am providing following training to people who want to learn SharePoint Development.
Please comment on this post for your questions.
Module I - Introduction to SharePoint (8 hr)
Please comment on this post for your questions.
Module I - Introduction to SharePoint (8 hr)
- What is a CMS?
- Microsoft Echo System
- SharePoint Job Roles
- SharePoint Architecture
- 3 Tier Architecture
- Central Admin - Walkthroughof CA
- SharePoint Site - Creating a Site Collection
- List and Libraries - Creating a List
- List and Libraries - Calendar, Tasks, Announcements, Document Lib, Images Lib
- Columns - Text Col, Date Col, Choice Col, Calculated Col, Lookup Col
- Views - Creating a View (Grouping, Filter, Sorting etc)
- Site Collection & Subsite - Difference between Site Collection & Sub Site.
- Site Settings - Change Site Name, Logo etc
- Navigation - Updating the Left Navigation
- Security - Site Owner (Owner), Member(Contributor), Visitor(Reader)
- Document Library - Creating a Document Library, Checking In/Out, Versioning.
- Content Type - Using Content Type in a Doc Lib.
- Editing Pages - Adding text to pages.
- Adding Pages - Creating a New Page
- Web Part - What is a Web Part?
- Adding Web Parts Adding - OOB web parts (Content Editor Web Part, Image Viewer Web Part, Youtube Video embedding).
- Advance Web Parts - List View Web Part etc
- Layout - Modifying the Page Layout
- Business Process - What is a Business Process?
- Workflow - What is a Workflow?
- Design - Design a workflow in Visio.
- Workflow Parts - Condition, Action and Properties.
- Develop - Develop a workflow using SharePoint Designer.
- HTML - Introto HTML5
- Customizing Pages - Creating New Pages
- WebPart - Customization Customizing the DataView Web Part
- Master Page - What is a Master Page? Difference between ASPX and Master Page
- Branding - Customizing the Master Page
- SDLC - Software Development Life Cycle
- C# - Intro to C#, Making the UI, Writing the code.
- ASP.NET - Intro to ASP.NET, Making the UI, Writing the code.
- Visual Web Part Development - Hello World Web Part, Web Part Life Cycle
- CAML - Query SharePoint Data
- Advance Web Part - Accessing data through Web Part
- Feature - Deployment of Web Part through features
- Scope - Farm, Site, Web, Web Application
- Reporting - What is a Report?
- Excel - Introduction to Excel
- Excel Services - Excel Web Access web part
- Publishing - Publishing an Excel to SharePoint.
- Excel Services - PowerPivot
- Excel Services - PowerView
- Dashboard - Lets build a Dynamic Dashboard.
- Java Script - Intro to JavaScript
- App - What is an App?
- SDLC - Software Development Life Cycle
- App LifeCycle - Client Side Object Model
- Development - Developing an App using Visual Studio
- Deployment - Deploying an App
- JSOM - JavaScript Object Model
- Advance App - Data driven app development
- App Security - App Scope and Permissions
Friday, September 19, 2014
Playing Video in SharePoint
In my recent project I have used JWPlayer to play videos in a SharePoint portal and it works great.
Here is the demo:
Here is the demo:
Loading the player...
Thursday, September 18, 2014
Subscribe to:
Posts (Atom)
-
Scenario: Updating the Master Page for SharePoint Online is not recommended by Microsoft now.....fine. So how do we change the UI then? And...
-
Microsoft introduced Office Graph a couple of months back which uses machine learning techniques to connect people to the relevant content,...
-
Recently I came across this amazing article of Claudio ( http://www.endusersharepoint.com/2009/04/20/finally-dynamic-charting-in-wss-no-code...
Official SharePoint Documentation
I have recently contributed to the official SharePoint documentation for developement. Check it out here: https://docs.microsoft.com/en-us...