---
title: Read application settings programmatically
slug: cms-11/dev-docs/reading-application-settings-programmatically-legacy
docTags: 
createdAt: 2026-07-22T19:45:16.749Z
---

Using a configuration class, you can access Optimizely Content Management System (CMS) settings. Settings are typed members of this class, which gives the added benefit of accessing settings through Intellisense. The class responsible for serving application settings is [EPiServer.Configuration.Settings.Instance](https://world.optimizely.com/documentation/Class-library/?documentId=cms/10/761F7911), defined as:

```javascript
public static Settings Instance
```

Accessing the settings through the use of the `Instance` property lists settings for the application.

The following example shows how to read and present application settings by using `EPiServer.Configuration.Settings.Instance`.

:::hint{type="info"}
**Note**
Reading the Optimizely CMS settings programmatically slows down the website.
:::

### Code-behind in ApplicationSettingsPage.aspx.cs

```csharp
using System;
using System.Text;
using System.Collections.Generic;
using System.Reflection;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.Web.WebControls;

using EPiServer.Configuration;
using EPiServer.Web;

namespace CodeSamples {
  public partial class ApplicationSettingsPage: EPiServer.TemplatePage {
    protected void Page_Load(object sender, EventArgs e) {
      lblUrlRewriteExtension.Text = Settings.Instance.UrlRewriteExtension;
      lblUIUrl.Text = Settings.Instance.UIUrl.ToString();

      // To read custom settings from the <appSettings> block in web.config
      // use code similar to:
      string customSetting = System.Web.Configuration.WebConfigurationManager.AppSettings["myCustomSetting"];
    }
  }
}
```

### Markup in ApplicationSettingsPage.aspx

```html
<table cellspacing="4" border="1">
  <tr>
    <td>UrlRewriteExtension</td>
    <td><asp:label id="lblUrlRewriteExtension" runat="server" text="Label" /></td>
  </tr>
  <tr>
    <td>The UI URL</td>
    <td><asp:Label id="lblUIUrl" runat="server" /></td>
  </tr>
</table>
```

The output from this code should resemble something like the following (depending on the actual configuration):

| UrlRewriteExtension | .htm                  |
| ------------------- | --------------------- |
| The UI URL          | `~/EpiServerTest/ui/` |
