1

I'm working on a site where the client's administrators are very tired of having to work with lists when they need to configure a custom feature we implemented for them.

Instead of them having to go in to a list to edit an item I thought of creating a custom application page which has a form with some fields. Additionally I would love to get rid of the lists as I think it is bad design to have a list for only 1 item.

Is it possible to create an application page like the OOTB SharePoint system pages and not have to save the values in lists? Can I save them in a hashtable or directly in the content db, or any other place for that matter?

3

I guess it depends on the scope of your feature.

If farm: You could use a custom service application (data gets saved to own database). It is not the easiest implementation, but it gives you lots of control http://msdn.microsoft.com/en-us/library/gg193964.aspx

For site or web scope, you could use the corresponding property bags of SPSite or SPWeb http://bramnuyts.be/2012/01/10/working-with-spwebs-propertybag/

Something like this in PowerShell (easily converted to C#):

$web = Get-SPWeb http://sharepoint

# To add
$web.AddProperty("SPWebObjectKey", $web)
$web.Update()

# To read
$tempWeb = $web.GetProperty("SPWebObjectKey")
Write-Host $tempWeb.Url

# To delete
$web.DeleteProperty("SPWebObjectKey")
$web.Update()
  • Will values saved to the property bag persist until deleted or will they expire after e.g. a IISreset? – user2536 Aug 25 '14 at 13:41
  • They are presistant! So they survive an IISRESET – Robert Lindgren Aug 25 '14 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy