Category Archives: sharepoint

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(); Advertisements

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

Creating Custom sharepoint alert template

<?xml version=”1.0″ encoding=”utf-8″?> <AlertTemplates> <AlertTemplate Type=”List” Default=”true” Name=”SPAlertTemplateType.GenericList”> <EventTypes IsVisible=”True”/> <Format> <Digest> <Header><HTML><![CDATA[<html dir = $Resources:core,PageDirection;> <head> <base href=”]]></HTML><GetVar Name=”SiteUrl” URLEncodeAsURL=”TRUE” /><HTML><![CDATA[“> <style> <!– .headertop1 { width: 100%; } .headercontent { color: #000000; font-family: $Resources:core,Alert_headercontent_font;; font-size: $Resources:core,Alert_headercontent_fontsize;; } .headercontent em … Continue reading

Posted in sharepoint | 2 Comments

Problem with Core.resx file in sharepoint

Use of core.en-GB.resx file with core.resx file creates an issue like the resource key won’t get replaced by the resource string value. You can either copy all the content into core.en-GB.resx or just removing the resx file with the current … Continue reading

Posted in sharepoint | 2 Comments