1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Populate a second drop down list upon selection value of first drop down list

Discussion in 'JavaScript' started by wonder_gal, May 9, 2007.

  1. #1
    Hi,

    I have 2 drop down lists, and I want to populate the content of the second drop down list according to the selected value from the first drop down list. May I know for VB.NET, how shall I specify that my second drop down list is being populated upon changes of selection from first drop down list? Below is the HTML code for my first drop down list.

    
    <asp:DropDownList id="selCompanyName" style="Z-INDEX: 107; LEFT: 136px; POSITION: absolute; TOP: 32px" runat="server" DataTextField=" Company_Name" DataValueField="GW_Acct_Id" AutoPostBack="True"></asp:DropDownList>
    
    Code (markup):
    Is that I need to add an attribute namely "onSelectedIndexChanged" here?
    And if yes, what if I would like to call a function from VB.NET code-behind upon the selection of the first drop down list? Is it like

    
    <asp:DropDownList id="selCompanyName" style="Z-INDEX: 107; LEFT: 136px; POSITION: absolute; TOP: 32px" runat="server" DataTextField=" Company_Name" DataValueField="GW_Acct_Id" AutoPostBack="True" [B]onSelectedIndexChanged="<%#FunctionName()%>"[/B]></asp:DropDownList>
    
    Code (markup):
    Kindly advice.
    Thanks.
    SEMrush
     
    wonder_gal, May 9, 2007 IP
    SEMrush
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,427
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    ajsa52, May 9, 2007 IP