Hello Everyone,

Could you please tell me why my dropdown not firing selectindexchange event. I have dynamic load that dropdown box using dataset. My problem this I have two dropdown boxes now I have load Brand Information in first one and when I select the brand all printers info load in second dropdown list.

HMTL

<asp:DropDownList ID="ddlSelectBrand" runat="server" 
                                CssClass="Sidebar-DropdownList" AutoPostBack="True" EnableViewState="true" Height="22px" OnSelectedIndexChanged="ddlSelectBrand_SelectedValueChanged">
                                <asp:ListItem Selected="True" Text = "- Select a Brand -"></asp:ListItem>
                            </asp:DropDownList>

Binding Information

ddlSelectBrand.DataSource = wseCommerce.LoadBrand().Tables(0)
        ddlSelectBrand.DataValueField = wseCommerce.LoadBrand().Tables(0).Columns("ManufacturerName").ColumnName.ToString()
        ddlSelectBrand.DataTextField = wseCommerce.LoadBrand().Tables(0).Columns("ManufacturerName").ColumnName.ToString()
        ddlSelectBrand.DataBind()

Event

Protected Sub ddlSelectBrand_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlSelectBrand.SelectedValueChanged
        If ddlSelectBrand.SelectedValue <> "" Then
            ddlSelectCatridge.Enabled = True
            ddlSelectPrinter.Enabled = True

            'Load Printer against Brand Name
            ddlSelectPrinter.DataSource = wseCommerce.LoadPrinter(ddlSelectBrand.SelectedValue).Tables(0)
            ddlSelectPrinter.DataValueField = wseCommerce.LoadPrinter(ddlSelectBrand.SelectedValue).Tables(0).Columns("PrinterName").ColumnName.ToString()
            ddlSelectPrinter.DataTextField = wseCommerce.LoadPrinter(ddlSelectBrand.SelectedValue).Tables(0).Columns("PrinterName").ColumnName.ToString()
            ddlSelectPrinter.DataBind()
        Else
            ddlSelectCatridge.Enabled = False
            ddlSelectPrinter.Enabled = False
        End If

    End Sub

hope you would understand my problem.

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.