Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1559

Retrieve AppSettings in HTML

$
0
0

I'm trying to set the text of a label on a webform equal to the value of a "key" in Web.Config. Here's the html code that returns an error saying "Operand ConfigurationManager is not declared":

<body>

<formid="form1"runat="server">

<div>

<asp:LabelID="Label1"runat="server"Text='<%# ConfigurationManager.AppSettings["KeyName"] %>'></asp:Label>

</div>

</form>

</body>

 

 

And it's trying to retrieve the value from Web.Config (very similar to the Micro Focus example solution BookDemoWebApplication):

 

<?xmlversion="1.0"?>

<configuration>

<configSections>

<sectionGroupname="MicroFocus.COBOL.Application">

<sectionname="Environment"type="System.Configuration.NameValueSectionHandler" />

</sectionGroup>

</configSections>

<MicroFocus.COBOL.Application>

<Environment>

<addkey="KeyName"value="KeyValue"/>

</Environment>

</MicroFocus.COBOL.Application>

<system.web>

<compilationbatch="false"debug="false"targetFramework="4.0" />

</system.web>

<system.webServer>

<modulesrunAllManagedModulesForAllRequests="true"/>

</system.webServer>

<system.codedom>

<compilers>

<compilerlanguage="COBOL"extension=".cbl"compilerOptions="sourceformat(variable) warnings(2)"type="MicroFocus.COBOL.CodeDom.COBOLCodeProvider, MicroFocus.COBOL.CodeDom, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0412c5e0b2aaa8f0"/>

</compilers>

</system.codedom>

</configuration>

 


Viewing all articles
Browse latest Browse all 1559

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>