Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 16551 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > How to display the listitems when the item has selected in the main dropdow ...
Sumasri

How to display the listitems when the item has selected in the main dropdownlist

Replies: 1 | Posted by: Sumasri on 6/29/2012 | Category: ASP.NET Forums | Views: 187 | Status: [Member] | Points: 10  


Hello Friends
I have a question.. Please suggest me the responding code for this.
I have taken 3 dropdownlists, in the first dropdownlist have added item groups like cars, bikes etc.,
If I select the car item then the corresponding car names have to be displayed in the second dropdownlist at the same time the third dropdownlist will be hided
and like for the bike item.

Thanks
suma.

sumasri


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Kamalakanta.Nayak09
Kamalakanta.Nayak09  
Posted on: 6/29/2012 9:59:29 AM
Level: Starter | Status: [Member] | Points: 25

Simple In side the Combobox1 fire event you just call a fill method which will retrive data from db and bind in Combobox2.
In Combobox1 do AutoPostBack="True"
like Ex:-
<pre lang="cs">protected void Combobox1_SelectedIndexChanged(object sender, EventArgs e)

{
FillMethod(Combobox1.SelectedValue);
}</pre>
public void FillMethod(int CategoryId)
{
//Fetch data from db where id=CategoryId
//Bind data into Combobox2
}

Thanks,
K.K

Sumasri, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/19/2013 4:45:26 AM