Access settings in an ASCX Page Template Layout

Tommy De Notarpietro asked on November 14, 2016 13:28

How can I access a setting in a ASCX page template layout? I tried using <%= CMS.DataEngine.SettingsKeyInfoProvider.GetStringValue(SiteContext.CurrentSiteName + ".setting") %>, but it doesn't recognize "GetStringValue".

Correct Answer

Anton Grekhovodov answered on November 14, 2016 13:53

Hi Tommy,

Use GetValue instead of GetStringValue, because GetStringValue can be obsolete.

Also, maybe you need to add namespace to SiteContext class (CMS.SiteProvider)

1 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.