Computer Magic Logo
Read value

Monday, March 14, 2016

Published by Aristotelis Pitaridis

In order to read a value we use the GetValue static member function of the Settings class. The first parameter is the Application name, the second parameter is the Setting name and the third parameter which is options is used to define the default value which will be used in case that there is not a value stored for the specific Application name and Setting name.

@using CMUmbracoTools.Data
@{ 
    string Username = Settings.GetValue("MyApplicationName", "Username", "pitaridis");
}