asp.net-mvc - Html Helper 不包含 Highsoft 的定义
问题描述
我正在使用 asp.net mvc 开发简单的 Web 应用程序,将此包添加到我的 nuget:
highsoft.web.mvc version 5.0.10.1
并尝试将图表添加到查看页面:
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
@(Html.Highsoft().GetHighcharts(
new Highcharts
{
Chart = new Highsoft.Web.Mvc.Charts.Chart
{
PlotBackgroundColor = null,
PlotBorderWidth = null,
PlotShadow = new Shadow
{
Enabled = false
}
},
Title = new Title
{
Text = "Browser market shares at a specific website, 2014"
},
Tooltip = new Tooltip
{
PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"
},
PlotOptions = new PlotOptions
{
Pie = new PlotOptionsPie
{
AllowPointSelect = true,
Cursor = PlotOptionsPieCursor.Pointer,
DataLabels = new PlotOptionsPieDataLabels
{
Enabled = true,
Format = "<b>{point.name}</b>: {point.percentage:.1f} %"
}
}
},
Series = new List<Series>
{
new PieSeries
{
Name = "Browser Share",
Data = @ViewData["pieData"] as List<PieSeriesData>
},
}
}
, "chart")
)
但在这一行:
@(Html.Highsoft().GetHighcharts(
得到这个错误:
Html Helper 不包含 Highsoft 的定义
我该如何解决这个问题?谢谢。完整的错误信息:
CS1929:“HtmlHelper”不包含“Highsoft”的定义,并且最佳扩展方法重载“HtmlHelperExtensions.Highsoft(IHtmlHelper)”需要“IHtmlHelper”类型的接收器
解决方案
推荐阅读
- python - 'self' 作为 PyQt5 中的参数有什么不同
- excel - 执行循环时读取下一行
- javascript - 在地图(JS)中使用标识符(下划线)
- android - 如何从 android 源代码(aosp 镜像)构建 settings.apk 进行设置?
- css - 在 python 烧瓶项目中管理引导程序的最佳方法
- c - 如何在集群上运行 MPI 和 OpenMp 的混合代码
- hadoop - hadoop start namenode error root account is not found
- php - 使用 JSON_FORCE_OBJECT 参数时如何在 php json 编码函数中删除 JSON 对象 ID
- database - 带有 Firebase / Firestore 的博客应用程序的数据模型
- android - 将类别列表存储在静态变量中以在另一个活动中使用