Click here to Skip to main content
15,909,747 members
Please Sign up or sign in to vote.
4.00/5 (3 votes)
See more:
Hi
in an page we are having 4 columns and the data's are stored in the database

we have 1 dropdownbox and 3textbox
when we select an item from dropdown box the related detail for the item should be displayed in the textbox

for eg
we have names in dropdown when we select the name that persons details (phoneno,address,age) should be displayed in the related textbox
can any one say how to write a program for this in asp
Posted

1 solution

1. Make Autopostback proprty of combobox true.
2. Write in SelectedIndex changed event.
C#
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        //Use DropDownList1.SelectedItem.ToString() to Get selected Text
        //Use DropDownList1.SelectedValue.ToString() to Get selected value

        //Execute query to fetch detail of seleted item
        //Set result to different textboxes
    
}

HAPPY CODING :laugh: ;)

Mark As Answer/Solution if it is useful to you..
 
Share this answer
 
Comments
m@dhu 25-Feb-11 2:09am    
Nice and simple.
Dave Paras 25-Feb-11 2:25am    
Thanks for vote mkgoud..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900