我在ASP.net 4.0中编写了这个简单的程序:
Dim x, y
Dim xcircle() As Double = New Double(360) {}
Dim ycircle() As Double = New Double(360) {}
For t = 0 To 360 Step 1
x = Math.Cos(t * Math.PI / 180)
y = Math.Sin(t * Math.PI / 180)
xcircle(t) = x
ycircle(t) = y
Next t
Chart1.Series("Series1").Points.DataBindXY(xcircle, ycircle)
我一直收到这个错误:
System.Web.HttpException:执行ChartImg.axd的子请求时出错。
这是我的web.config:
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;" />
</appSettings>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
</httpHandlers>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
<remove name="ChartImageHandler" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
</system.webServer>