怎么样正确得到在web.config中设的值?
raozr 2003-05-27 02:07:53 我的web.config.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="test">
<section name="SimpleSettings"
type="System.Configuration.NameValueSectionHandler" />
</sectionGroup>
</configSections>
<test>
<SimpleSettings>
<add key="myurl" value="/Test/finalpage.aspx" />
</SimpleSettings>
</test>
而在ASP.net 的文件中写:
System.Collections.Specialized.NameValueCollection SimpleSettings = (System.Collections.Specialized.NameValueCollection)System.Configuration.ConfigurationSettings.GetConfig("Test/SimpleSettings");
而这个SimpleSettings 总是为null.
是哪出问题了, 各位帮帮忙!!