How to read web.config APP key settings in HTML markup

In addition to using <%=ConfigurationManager.AppSettings["MyAttribute"]%>, as others have noted, you can also use expression builders. The syntax is a little different. Instead of <%=...%> you use <%$ AppSettings: MyAttribute %>, like so:

<object id="myObjectID attr="<%$ AppSettings: MyAttribute %>" ...>

If you are just dumping an appSettings value directly into static HTML (as I presume you are in this example), these two approaches are identical for all practical purposes.

What is nice about expression builders, though, is that you can use them to declaratively assign appSettings values to Web control properties, something you cannot do with the <%=...%> syntax. That is, with expression builders you can do something like:

<asp:Label runat="server" ... Text="<%$ AppSettings: MyAttribute %>" />

Whereas you could not do:

<asp:Label runat="server" ... Text="<%=ConfigurationManager.AppSettings["MyAttribute"]%>" />

The following code:

<%$ AppSettings: MyAttribute %>

is not compatible with general HTML markup and JavaScript function! It's good for asp tag.

Whereas

<%=ConfigurationManager.AppSettings("MyAttribute")%>

really work in general HTML markup.

so

<%=ConfigurationManager.AppSettings("MyAttribute")%>

is my recommendation!