Friday, November 1, 2013

How to set configuration in Empty SharePoint Project

hi


you need to add new entry in configuration/appSettings section:



<appSettings>
<add key="ServiceUrl" value="http://localhost:449555" />
</appSettings>

After that you will be able to use it in your code like this:



var rc = new RestClient(ConfigurationManager.AppSettings["ServiceUrl"]);

In order to add new setting to appSettings section via SPWebConfigModifications, see the following post: Adding and Removing keys from appSettings in web.config.



Blog - http://sadomovalex.blogspot.com

Dynamic CAML queries via C# - http://camlex.codeplex.com


No comments:

Post a Comment