无法识别的配置节页面

时间:2013-10-30 13:20:55

标签: asp.net highcharts web-config dotnethighcharts

我在aspx页面中使用highcharts时遇到错误。

无法识别的配置部分页面。

错误发生在web.config文件中

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionStrings>
    <add name="MyConsString" connectionString="Data Source=INBDQ2WK2LBCD2S.\SQLEXPRESS;Initial Catalog=MCAS;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>
    <add name="MCASConnectionString" connectionString="Data Source=INBDQ2WK2LBCD2S\SQLEXPRESS;Initial Catalog=MCAS;Integrated Security=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <packages>
    <package id="DotNet.Highcharts" version="2.0" targetFramework="4.5"/>
  </packages>
  <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
    <controls>
      <add tagPrefix="highchart" namespace="Highchart.UI" assembly="Highchart"/>
    </controls>
  </pages>
  <system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>
  </system.web>
</configuration>

1 个答案:

答案 0 :(得分:1)

下面的标签应该在system.web标签内。

  <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
    <controls>
      <add tagPrefix="highchart" namespace="Highchart.UI" assembly="Highchart"/>
    </controls>
  </pages>

完全正常工作的web.config

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionStrings>
    <add name="MyConsString" connectionString="Data Source=INBDQ2WK2LBCD2S.\SQLEXPRESS;Initial Catalog=MCAS;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>
    <add name="MCASConnectionString" connectionString="Data Source=INBDQ2WK2LBCD2S\SQLEXPRESS;Initial Catalog=MCAS;Integrated Security=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.web>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
      <controls>
        <add tagPrefix="highchart" namespace="Highchart.UI" assembly="Highchart"/>
      </controls>
    </pages>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>
  </system.web>
</configuration>