==========大家看过来一下一个web.config问题==============
参照帮助中的例子做的,出错了一直找不到错在了哪里;
例子地址在Visual studio2003帮助中的:
Visual Studio .NET/.NET Framework/Configuration Section Settings/Declaring and Accessing Custom Configuration Sections
操作步骤如下:
1.新建一个web application
2.修改web.config文件如下:
在<Configuration>块下添加:
<configSections>
<section name="sampleSection"
type="System.Configuration.SingleTagSectionHandler" />
</configSections>
<sampleSection setting1="Value1" setting2="value two"
setting3="third value" />
....
<configSections>
3. 然后在Page_Load事件中将例子的后台代码拷贝进去
private void Page_Load(object sender, System.EventArgs e)
{
IDictionary sampleTable = (IDictionary)
ConfigurationSettings.GetConfig("sampleSection");
string value1 = (string)sampleTable["setting1"];
string value2 = (string)sampleTable["setting2"];
string value3 = (string)sampleTable["setting3"];
}
4. 可是老是报一个这样的错误请大家帮忙看看这是为什么....查了很久没有查出来....55555
Error Information:
Configuration Error
Parser Error Message: Exception creating section handler.
Source Error:
Line 4: <configSections>
Line 5: <section name="sampleSection"
Line 6: type="System.Configuration.SingleTagSectionHandler, System" />
Line 7: </configSections>
十分疑问中...........