Web Application Properties as JSON
By Anatoly Mironov
I saw an interesting question on sharepoint.stackexchange: How to access a Web application/Farm level property bag via jQuery/Javascript/ClientContext. Some time ago I tested a custom http handler, so I wanted to try a custom httphandler for this as well. It worked. Here more details: Just deploy sp-lend-id.tupsam from the solution. If you don’t have any properties in your web application, just add some:
asnp microsoft.sharepoint.powershell
$app = get-spwebapplication http://dev
$app.Properties.Add("Santa", "Claus")
$app.Properties.Add("Ded", "Moroz")
$app.Properties.Add("Hel", "Muci")
$app.Update()
Then just to test open the httphandler directly in the browser:
http:///\_layouts/sp-lend-id/tupsam/properties.ashx
Then add the script to your solution where you need it (customaction, masterpage…) and whenever you want some web application property just use it:
\_webAppProperties.Santa