Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

it is possible to store custom settings (configuration) on a SharePoint.

Means : I have a configuration that add to General Settings List . I set up my settings for this list.

Edit :

I use the feature to implement a custom action. Change the Elements.xml file of the Feature to look like:

<?xml version="1.0" encoding="utf-8" ?>

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="Custom.Configuration.ListCustomSettings"
GroupId="GeneralSettings"
Location="Microsoft.SharePoint.ListEdit"
RequireSiteAdministrator="FALSE"
Sequence="100"
Title="Custom Settings">
<UrlAction
Url="_layouts/ListCustomSettings/ListSetting.aspx?List={ListId}" />
</CustomAction>
</Elements>

The next step is to create a custom page which we can redirect to and on which we can mange the custom settings.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You can do that with a custom action. Use "Microsoft.SharePoint.ListEdit" as custom location and "GeneralSettings" as groupid. There you can set the path to you custom settingspage.

Samplecode:

Id="Custom.Configuration.ListCustomSettings"
GroupId="GeneralSettings"
Location="Microsoft.SharePoint.ListEdit"
RequireSiteAdministrator="FALSE"
Sequence="100"
Title="Custom Settings"
UrlAction Url="_layouts/ListCustomSettings/ListSetting.aspx?List={ListId}"

To save the custom properties use:

SPContext.Current.List.RootFolder.Properties[strPropertyKey] = strValue;
SPContext.Current.List.RootFolder.Update();

And to read them:

strValue = SPContext.Current.List.RootFolder.Properties[strPropertyKey].ToString();

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.