平台 Visual 2012 +sql 2008
使用控件EXT.net
图表是使用:hightchart
我从数据库中获取了部门信息,在Hit_charts.aspx中动态生成了对应的Ext:Panel,然后想在动态生成的panel里加载用户控件Charts_UserControl.ascx,该用户空间里面HTML内容如下:
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<div id="container" style="width: 100%; height: 100%">
</div>
Hit_charts.aspx.cs中动态生成Ext:Panel代码如下:
private void depcount(string id, string dname)
{
Ext.Net.Panel panel = new Ext.Net.Panel();
panel.ID = "Panel_" + id;
this.Gtab_deps.Items.Add(panel);
Ext.Net.Panel dep_panel = new Ext.Net.Panel();
dep_panel.ID = "dep_P_" + id;
dep_panel.Title = dname;
panel.Items.Add(dep_panel);
}
private void fricount(string did, string fid, string fname)
{
Ext.Net.Panel panel = (Ext.Net.Panel)this.FindControl("Panel_" + did);
Ext.Net.Panel pta = (Ext.Net.Panel)this.FindControl("dep_P_" + did);
Ext.Net.Panel fri_panel = new Ext.Net.Panel();
fri_panel.ID = "Panel_" + did + "_" + fid;
fri_panel.Title = fname;
fri_panel.Icon = Ext.Net.Icon.ControlBlank;
panel.Items.Add(fri_panel);
Ext.Net.Panel fri_panel_charts = new Ext.Net.Panel();
fri_panel_charts.ID = "PanelCharts_" + did + "_" + fid;
fri_panel_charts.Title = fname;
fri_panel_charts.Height = 600;
fri_panel_charts.Border = true;
fri_panel.Items.Add(fri_panel_charts);
Ext.Net.UserControlLoader UCL = new UserControlLoader();
UCL.Path = "../Account/HitCharts/Charts_UserControl.ascx";
fri_panel_charts.Controls.Add(UCL);
}
现在出现的问题是,图表没有加载到fri_panel_charts里面,网上都找不到类似问题,只好求助大神们!!!!
------解决思路----------------------
container.Render();不好意思,应该是这个。