Edit the Web.Config
To enable the controls you have to edit the web.config file.
Add this under the controls tag (path: "<system.web><pages><controls>") :
<add tagPrefix="asp"
namespace="System.Web.UI.DataVisualization.Charting"
assembly="System.Web.DataVisualization, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
And add this httpHandler (under "<httpHandlers>") :
<add path="ChartImg.axd" verb="GET,HEAD"
type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler,
System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" validate="false"/>
在web.config文件下的 appSettings 标签内加入:
<add key="ChartImageHandler" value="Storage=file;Timeout=20;Url=~/tempImages/;"/>
当然,工程下面也要有 tempImages 这个文件夹,同时也要为该文件夹,设置修改写入的权限哦!~