_spPageContextInfo not found on the page
Add the following code to the page : <!DOCTYPE html> <%@ Page language="C#" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <html> <head> </head> <body> <form runat="server"> <SharePoint:FormDigest ID="FormDigest1" runat="server"></SharePoint:FormDigest> </form> </body> </html> You need to add the following code in case of JSOM: <!DOCTYPE html> <%@ Page language = "C#" %> <%@ Register Tagprefix = "SharePoint" Namespace = "Microsoft.SharePoint.WebControls" ...