Results 1 to 7 of 7

Thread: dropdown cascade update

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    617

    dropdown cascade update

    hi team, how can i update another dropdownlist without posting back. i've seen the sample somewhere but its not doing anything.

    html
    Code:
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="false" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
                    <asp:ListItem Value="0">----Select----</asp:ListItem>
                    <asp:ListItem Value="101">General Admin</asp:ListItem>
                    <asp:ListItem Value="102">Admin Assistant</asp:ListItem>
                    <asp:ListItem Value="103">Software</asp:ListItem>
                    <asp:ListItem Value="104">Recruiting</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="DropDownList2" runat="server">
                    <asp:ListItem Value="0">----Select----</asp:ListItem>
                    <asp:ListItem></asp:ListItem>
                </asp:DropDownList>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged" />
            </Triggers>
        </asp:UpdatePanel>
    VB
    Code:
        Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
            DropDownList2.Items.Clear()
            Select Case DropDownList1.SelectedValue
                Case 101
    
                    DropDownList2.Items.Add("monster truck")
                    DropDownList2.Items.Add("pacman")
                Case 102
                    DropDownList2.Items.Add("ghos in the shell")
                    DropDownList2.Items.Add("bomber man")
            End Select
        End Sub
    Learn something new every .001 second.

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: dropdown cascade update

    Hey,

    If you are already using AJAX, then why not simply use this:

    http://www.asp.net/ajax/ajaxcontrolt...gDropDown.aspx

    Gary

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    617

    Re: dropdown cascade update

    great link, always. i've been looking googling for that site.

    rolling again. many thanks. your simply the great \/m
    Learn something new every .001 second.

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: dropdown cascade update

    Hey,

    I have that one as a favourite, I always seem to be linking to that site

    Not a problem at all.

    Can you remember to mark your thread as resolved?

    Thanks

    Gary

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    617

    Re: dropdown cascade update

    Hey,

    OMG first demo run i have all the red squirky line on markup. i already have the toolkit installed. codes are funny to watch it will keep all my hair fall... hayz. i will enjoy these soon.
    Learn something new every .001 second.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    617

    Re: dropdown cascade update

    hey,

    isnt it too much for a simple thing to do? any other suggestion out there?

    thanks.
    Learn something new every .001 second.

  7. #7
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: dropdown cascade update

    Hey,

    Can you show the code that you are trying? I am not sure that I fully understand the problem that you are having?

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width