偶写了一个用DropDownList来实现数据库查询的程序
语言是asp.net + vb.net + Dundas.Chart(.net图表组件)
但最后运行结果是:打开网页时图表能显示出来,是“nov”的,但改变DropDownList选项时图表不变
我没用过这个控件,不过感觉应该是回传后,要重新绑定一次。
Chart1.DataBind()
DropDownList的selectindexchanaged的事件中去根据DropDownList选择的值去查询.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Me.IsPostBack Then
给要帮定的控件取数据帮定
End If
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
CODEGEN: 此方法调用是 Web 窗体设计器所必需的
不要使用代码编辑器修改它。
InitializeComponent()
End Sub
照常这样写,不能象你上面那样写。。
就是说要把你的拌定你的dropdownlist的这个拌定的那些代码写到
page_load这个事件中
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
在此处放置初始化页的用户代码
If Not IsPostBack Then
这里放拌定你的dropdownlist的代码
End if
End Sub
还有你提到了更改后没效果,你更改的时候是在dropdownlist的SelectedIndexChanged事件中做吗?