3

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.

1 Answer 1

7

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:

  <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>

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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