2

在 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>
4

1 回答 1

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>
于 2013-10-30T13:29:18.307 回答