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
webApp.WebConfigModifications.Add(webEntry);
webApp.Farm.Services.GetValue().ApplyWebConfigModifications();
}
Web Config Entry could be
"SafeControl[@Assembly="MyAssembly"][@Namespace="My.Namespace"]"
+ @"[@TypeName="*"][@Safe="True"][@AllowRemoteDesigner="True"]"
Entry location could be
configuration/SharePoint/SafeControls
Subscribe to:
Post Comments (Atom)
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 ...
-
#Add a sharepoint group using power shell #Create a sharepoint custom permission using Power shell $web = get-SPWeb "http://sitecollect...
-
I am very sure that most of the Sharepoint developers must have used _spBodyOnLoadFunctionNames to inject javascript methods on the sharepo...
-
This issue occurs when you do backup restore of the site/site collection. Due to this you can not see the page in design mode due to some re...
No comments:
Post a Comment