---
title: Settings
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

List of examples:

### Getting the values of settings

```csharp

// Note: To find the code names of setting keys, open the Modules application in Kentico, edit a module and view the Settings tab

// Gets the value of the "Page not found URL" setting for the current site
string pageNotFoundUrl = SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".CMSPageNotFoundUrl");

// Gets the global value of the "Scheduled tasks enabled" setting 
bool scheduledTasksEnabled = SettingsKeyInfoProvider.GetBoolValue("CMSSchedulerTasksEnabled");

// Gets the value of the "Application scheduler interval" setting for the current site
int schedulerInterval = SettingsKeyInfoProvider.GetIntValue(SiteContext.CurrentSiteName + ".CMSSchedulerInterval");

```

[> Back to list of examples](#settings-toc)

### Getting the values of web.config keys

```csharp

// Gets the value of the "CMSApplicationName" key from the appSettings section of the web.config
string webConfigSetting = ValidationHelper.GetString(SettingsHelper.AppSettings["CMSApplicationName"], "");

```

[> Back to list of examples](#settings-toc)

### Setting values for settings

```csharp

// Sets the value of the "Page not found URL" setting to "~/System-pages/NotFound" for the current site
SettingsKeyInfoProvider.SetValue("CMSPageNotFoundUrl", SiteContext.CurrentSiteName, "~/System-pages/NotFound");

// Sets the value of the global "Scheduled tasks enabled" setting to false
SettingsKeyInfoProvider.SetGlobalValue("CMSSchedulerTasksEnabled", false);

// Sets the value of the "Application scheduler interval" setting to 30 for the current site
SettingsKeyInfoProvider.SetValue("CMSSchedulerInterval", SiteContext.CurrentSiteName, 30);

```

[> Back to list of examples](#settings-toc)
