【发布时间】:2015-03-16 10:22:19
【问题描述】:
我在 asp.net 中绘制了一个高图。我工作正常,但是当我将提交按钮放在更新面板中时,highchart 不起作用。它没有重绘。 页面未重新加载,因此未重绘。
aspx代码-
<asp:UpdatePanel runat="server" ID="update1">
<ContentTemplate>
<asp:Button ID="button_borrowing_calculate" CssClass="SDButtonGrad" runat="server" Text="Calculate>>" Height="30px" Width="90px" OnClientClick="emptycheck();" OnClick="btn_bp_calculate_Click" /></ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="updatep">
<ContentTemplate>
<div id="rp_graph1" style="height: auto; width: 100%;" runat="server">
<highchart:LineChart runat="server" Height="300px" Width="99%" ID="hcLine" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
aspx.cs 代码-
protected void btn_bp_calculate_Click(object sender, EventArgs e)
{
hcLine.Title.text = "Borrowing Capacity";
hcLine.YAxis.Add(new YAxisItem { title = new Title("Amount") });
hcLine.XAxis.Add(new XAxisItem
{
categories = new[] { "0","1", "2","3", "4","5", "6","7", "8","9", "10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30",
"31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50"
}
});
var series = new List<Serie>();
series.Add(new Serie { data = new object[] { 400, 435, 446, 479, 554, 634, 687, 750, 831 } });
//bind
hcLine.DataSource = series;
hcLine.DataBind();
}
【问题讨论】:
-
能否贴出相关代码
-
您收到任何错误吗?
-
没有错误......我认为客户端脚本没有重新加载,因为这个图表没有在更新面板中重绘。计算后图表 div 为空。
标签: c# asp.net highcharts updatepanel