config.web配置文件如下: <!--config.web 请放入FormCfg.aspx所在目录--> <configuration> <!--申明一个test配置段--> <configsections> <add name="test" type="System.Web.Configuration.DictionarySectionHandler" /> </configsections> <test> <!--配置一个键key,其内容为just a configure test--> <add key="key" value="just a configure test" /> </test> </configuration> 通过以下代码读出其key值: <html> <head> <script language="VB" runat=server> sub page_load(s as object ,e as eventargs) Dim CfgSection As Hashtable = Context.GetConfig("test") Dim Msg As String = CStr(CfgSection("key")) lblMsg.text=Msg end sub </script> <title> 配置信息的读取 </title> </head>
<body> <center> config.web中"test"配置段中key的内容为: <asp:label id=lblmsg runat=server /> </center> </body>
</html> 就是编译不过,各位大虾,请问问题出在哪里呢?