Monthly Archives: March 2014

Migrating SharePoint ListItems

private void StartMigration() { StartProcess(txtSiteUrl.Text); } void StartProcess(string srcUrl) { Start_Export(srcUrl); } private void Start_Export(string srcUrl) { #region “Main” string SourceSiteName = srcUrl.Substring(srcUrl.LastIndexOf(“/”) + 1); string sourceUrl = srcUrl; string destURL = srcUrl; if (!string.IsNullOrEmpty(sourceUrl) && !string.IsNullOrEmpty(destURL)) { string secAdminID … Continue reading

Posted in sharepoint | Leave a comment

Set SharePoint Site Collection to Offline/ReadOnly

Offline SPSiteAdministration siteAdmin = new SPSiteAdministration(site.Url); siteAdmin.ReadLocked = true; siteAdmin.Dispose();   ReadOnly SPSiteAdministration siteAdmin = new SPSiteAdministration(newSite.Url); siteAdmin.ReadOnly = true; siteAdmin.Dispose();

Posted in sharepoint | Leave a comment

Adding Datasheet view in SharePoint2013

Add below to DatSheetvw.aspx.cs /*start*/ public partial class DatasheetV : LayoutsPageBase { protected PlaceHolder plActiveX; protected LinkButton linkList; protected void Page_Load(object sender, EventArgs e) { } protected override void CreateChildControls() { base.CreateChildControls(); StringBuilder stringBuilder = new StringBuilder(); try { string … Continue reading

Posted in sharepoint | Leave a comment