dropdownList的selectIndexChange事件没有触发
前台代码:
DSP <asp:dropdownlist id="cboDSP" runat="server" AutoPostBack="True" SelectedIndexChanged ="cboDSP_SelectedIndexChanged" ></asp:dropdownlist>
后台代码:
Sub cboDSP_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboDSP.SelectedIndexChanged
Dim strsql As String
Dim cn As New SqlClient.SqlConnection()
cn = obj.get_cn()
cn.Open()
'strsql = "select ds_code from t_dsp with (nolock) order by ds_code"
strsql = "select DC_TRANSFER_CODE from t_dsp inner join T_DSP_CITY on ds_code=dc_dsp with (nolock) order by ds_code where ds_code=" & "'" & cboDSP.SelectedItem.Value.ToString & "'"
obj.bind_dropdownlist(strsql, ddl_transfer_to, "DC_TRANSFER_CODE", "DC_TRANSFER_CODE", cn)
End Sub
我在SelectIndexChange事件设了断点,操作,发现没有执行到事件里面,怎么回事呢?
[解决办法]
页面的EnableViewState=true
[解决办法]
EnableViewState=true