Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

dropdown in asp.net(VB)

Posted on 2009-04-23
2
Medium Priority
?
221 Views
Last Modified: 2013-11-26
hello experts, i have two dropdowns, the first 1 contains 2 items, the search by price and search by category. Once the 1st item selected, it gotta show specific items in the 2nd dropdown such as 100-200,500-1000...and once the search by category is selected from the 1st dropdown, the price is hidden in the 2nd dropdown and the following options are made available actions, strategy,simulation is...how do i do that.
0
Comment
Question by:thomas455
2 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 500 total points
ID: 24221776
Try this Code
ASPX 
 
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
            <asp:ListItem Value="1">search by price</asp:ListItem>
            <asp:ListItem Value="2">search by category</asp:ListItem>
        </asp:DropDownList>
        <asp:DropDownList ID="DropDownList2" runat="server">
        </asp:DropDownList> 
 
Code behinde VB code
 
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Me.IsPostBack = False) Then
            BindPricedata()
        End If
 
    End Sub
 
    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
        If (DropDownList1.SelectedItem.Value = 1) Then
            BindPricedata()
        Else
            BindCatdata()
        End If
    End Sub
 
    Sub BindPricedata()
        DropDownList2.Items.Clear()
        DropDownList2.Items.Add("100-200")
        DropDownList2.Items.Add("500-1000")
 
    End Sub
    Sub BindCatdata()
        DropDownList2.Items.Clear()
        DropDownList2.Items.Add("actions")
        DropDownList2.Items.Add("strategy")
        DropDownList2.Items.Add("simulation")
    End Sub

Open in new window

0
 

Author Closing Comment

by:thomas455
ID: 31574089
yesy it works fine...thx
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question