【发布时间】:2017-02-20 19:04:51
【问题描述】:
为什么这个页面不显示布局或 ViewBag.Title? “MyChart”渲染正常,但是当调用“Write”函数时,它会将所有页面内容替换为渲染图像。有没有办法在渲染图像之后或之前向页面添加更多内容?
@model cmCase.Models.xyz
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Index</h2>
<div class="well">
@{
var myChart = new Chart(width: 1000, height: 400, theme: ChartTheme.Green)
.AddTitle("Most Popular")
.AddSeries(name: "Employee", xValue: new[] { "Peter", "Andrew", "Julie", "Mary", "Dave" }, yValues: new[] { "2", "6", "4", "5", "3" })
.AddSeries(name: "Employee12", xValue: new[] { "Peter", "Andrew", "Julie", "Mary", "Dave" },yValues: new[] { "2", "6", "4", "5", "3" })
.Write();
}
</div>
【问题讨论】:
标签: c# asp.net asp.net-mvc-4 razor