Public Sub DropDownList_changed(ByVal db_list As System.Object, ByVal e As System.EventArgs)
        ??????????????????
这里我要怎样写呢    End Sub

解决方案 »

  1.   

    把DROPDOWNLIST的AUTOPOSTBACK设置成TRUE
    你里面随便你怎么写
    例如:if dropdownlist.selectedindex=2 then
    end if
    if dropdownlist.selectitem.text="hello" then
    end if
      

  2.   

    string DD = DropDownList.SelectedIndexif DD == 2 then
      ....
    end if
      

  3.   

    把DROPDOWNLIST的AUTOPOSTBACK设置成TRUE
    你里面随便你怎么写
    例如:if dropdownlist.selectedindex=多少then
    end if
      

  4.   

    把DROPDOWNLIST的AUTOPOSTBACK设置成TRUE是在html代码页设吧?
      

  5.   

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            '在此处放置初始化页的用户代码
            Dim db_list As New DataGrid()
            Try
                f_sConnection = oCS.GetConnectionString()
                f_SipDbConnection = New OleDbConnection(f_sConnection)
                If Not IsPostBack Then
                    ShowTableList("1")            End If        Catch eLoad As System.Exception
                Me.Response.Write(eLoad.Message)
                f_SipDbConnection.Close()
            End Try    End Sub
        Private Sub ShowTableList(ByVal query_type As String)
            Dim view_name As String        If query_type = "1" Then
                sSqlString = "SELECT ASC_ID, AAC_NAME AS 广告商 FROM ADA_AAC_INFO_TABLE"
                view_name = "ADA_AAC_INFO_TABLE"        Else
                Exit Sub        End If        Try
                Dim dsDN As New DataSet()
                Dim sda_DN As New OleDbDataAdapter(sSqlString, f_SipDbConnection)
                dsDN.Clear()
                sda_DN.Fill(dsDN, view_name)
                If dsDN.Tables(view_name).Rows.Count > 0 Then
                    DropDownList1.DataSource = dsDN.Tables(view_name).DefaultView
                    DropDownList1.Visible = True
                    DropDownList1.DataTextField = "AAC_NAME"
                    DropDownList1.DataValueField = "ASC_ID"
                    DropDownList1.SelectedIndex = 0
                    DropDownList1.DataBind()                f_SipDbConnection.Close()
                Else
                    Exit Sub
                End If        Catch eLoad As System.Exception
                Me.Response.Write(eLoad.Message)
                f_SipDbConnection.Close()        End Try
        End Sub    Public Sub DropDownList_changed(ByVal db_list As System.Object, ByVal e As System.EventArgs)        db_list.CurrentPageIndex = 0       
        End SubEnd Class帮我看看,这样写调试时没有东西出来?
      

  6.   

    private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e) {
          string TCID=DropDownList1.SelectedValue.ToString().Trim();//取得字段
          string Conn= ConfigurationSettings.AppSettings.Get("Con");SqlConnection myconn=new SqlConnection(Conn);
    string sql="select xxxx,xxxxxfrom ProductCategory where(TotalCategoryId='"+TCID+"')";
       DataTable DT=new DataTable();
      SqlDataAdapter SDA=new SqlDataAdapter(sql,myconn);
     SDA.Fill(DT);
                      
                                   DropDownList2.DataSource=DT.DefaultView;
        DropDownList2.DataTextField="xxxxxx";      
        DropDownList2.DataValueField="xxxxxx";
        DropDownList2.DataBind();

    我是用C#写的,由DropDownList1控制DropDownList2,将你数据库的字段赋值给DropDownList2.DataTextField和DropDownList2.DataValueField就ok了
      

  7.   

    Public Sub DropDownList_changed(ByVal db_list As System.Object, ByVal e As System.EventArgs)response.write(drop.selecteditem.value)
    response.write(drop.selecteditem.text)    End Sub