Thursday, 23 December 2010

Manipulating web.config file programmatically

To modify/add a web config entry following code can be referred

// Get the SPSite object
SPSite site = new SPSite("URL");
if (site != null)
SPWebApplication webApp = site.WebApplication;
// Create the modification entry
SPWebConfigModification webEntry = new SPWebConfigModification("Web Config entry " ,"Entry location" );
// Add the web config entry to the collection

Web Config Entry could be

+ @"[@TypeName="*"][@Safe="True"][@AllowRemoteDesigner="True"]"

Entry location could be


No comments:

Query List/Document Library in Specific Folder

To query SharePoint List or Document Library in specific Folder “ FolderServerRelativeUrl ” as part of the CAML Query Code Snippet ...