Question : ASP.NET - use web.config setting to populate page title

I've got the following setting in my web.config file...

<appSettings>
        <add key="AppTitle" value="Ralph Sheffield"/>
    </appSettings>

I've seen it done before where this app setting can be utilized in markup.  Something like this...

<head runat="server">
    <title><% ConfigurationManager.AppSettings["AppTitle"].ToString(); %></title>
</head>

But this doesn't seem to be working.

So what is the correct way to do this?

Answer : ASP.NET - use web.config setting to populate page title

use =
<%= ConfigurationManager.AppSettings["AppTitle"].ToString() %>

or you can set that in code-behind as well ...say in page_load:
        Page.Title = ConfigurationManager.AppSettings["AppTitle"].ToString();
Random Solutions  
 
programming4us programming4us