2月 17, 2010

連動式下拉選單


    Protected Sub ddl_rt1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs)
        '史上最強無敵在DetailsView連動式下拉選單
        SqlDataSource3.SelectParameters("區域編號").DefaultValue = CType(DetailsView1.FindControl("ddl_rt1"), DropDownList).SelectedValue
    End Sub


    Protected Sub ddl_rt1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        DetailsView1.FindControl("ddl_rt2").Dispose() ' By zk
        SqlDataSource3.SelectParameters("區域編號").DefaultValue = CType(DetailsView1.FindControl("ddl_rt1"), DropDownList).SelectedValue
    End Sub


沒有留言: