i am creating a dropdown(dd2) dynamically inside a <div> , on the selected index event of another dropdown(dd1). somehow i am not able to handle or get the selectedindexch ange event of dd2. i get the values inside dd2, but does not respond to any event. i am using
the code is as below.
Expand|Select|Wrap|Line Numbers
- Function getdatafromdb(ByVal s As String) As String
- Try
- dtChild = New DataTable
- Select Case Trim(s).ToUpper
- Case UCase("sivsetupid"), UCase("sub"), UCase("subclient"), UCase("edm_id"), UCase("convrt_who"), UCase("audit_who"), UCase("siv_inject"), UCase("engine_built"), UCase("audit")
- 'Session("tblname") = "p"
- qrystr2 = "select distinct " + Trim(s) + " from edi_parent order by " + Trim(s) + ""
- Case UCase("carrname"), UCase("scac")
- qrystr2 = "select distinct " + Trim(s) + " from carreuro order by " + Trim(s) + ""
- 'Session("tblname") = "ca"
- Case UCase("clientname"), UCase("clientno")
- 'Session("tblname") = "cl"
- qrystr2 = "select distinct " + Trim(s) + " from clientdt order by " + Trim(s) + ""
- End Select
- mycmd = New MySqlCommand(qrystr2, myconn)
- mycmd.CommandTimeout = 0
- adap = New MySqlDataAdapter(mycmd)
- adap.Fill(dtChild)
- Dim ddlfiltervalue As New DropDownList
- ddlfiltervalue.ID = "ddlfiltervalue"
- ddlfiltervalue.DataSource = dtChild
- ddlfiltervalue.Items.Add("--SELECT--")
- ddlfiltervalue.DataTextField = s
- ddlfiltervalue.DataBind()
- Me.Controls.Add(ddlfiltervalue)
- Dim sw As New StringWriter
- Dim htw As New HtmlTextWriter(sw)
- ddlfiltervalue.RenderControl(htw)
- Return sw.ToString
- Catch ex As Exception
- Response.Write("Error filling data in child Grid" + ex.Message)
- Finally
- myconn.Close()
- End Try
- End Function