我在我的项目中使用Ajax图表(饼图,折线图,条形图)。所有对此ajax的引用都是正确的。它在旧版本中运行良好。当我升级到ajax Control Toolkit 4.1.40412.0时。我不能再编译我的项目了。错误显示:
Warning 2 Element 'PieChart' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.
我在web.config中添加了:
<pages validateRequest="false" clientIDMode="AutoID">
<controls>
<add tagPrefix="asp" assembly="AjaxControlToolkit"
namespace="AjaxControlToolkit" />
</controls>
</pages>
并以我的HTML形式:
<asp:PieChart ID="PieChart1" runat="server" ChartHeight="535" ChartWidth="535"
Visible="true" borderstyle="None" forecolor="White"></asp:PieChart>
我的网络配置中这个版本有什么问题?我还记得添加参考: qazxsw poi
名称空间'System.Web.UI.WebControls'中不存在类型或命名空间名称'PieChart'(您是否缺少程序集引用?)
要使其工作,请更改标记前缀
web.config中
tagPrefix="asp"
标记
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
NuGet Package Link:<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<ajaxToolkit:PieChart ID="PieChart1" runat="server"
ChartHeight="535"
ChartWidth="535"
Visible="true"
BorderStyle="None"
ForeColor="White">
</ajaxToolkit:PieChart>