Click here to Skip to main content
15,900,589 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am working on asp.net list control. I am getting the data into the listbox from the database(book information) and the autopostback for listbox is true. I displayed the book name in the listbox.

Now my question is, can I display the book information like book author, id , publisher etc in textboxes for each bookname selected in listbox.

Thanks and regards,
lepakshi reddy.G
Posted
Updated 28-Sep-10 8:26am
v2

You can do anything you would like. Handle the selectedIndexChange event for the listbox and either manually set the textboxes or use databinding.
 
Share this answer
 
Yes, You can do it.

C#
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        string bookName=ListBox1.SelectedItem.Text;
        ShowBookDetails(bookName);
    }

    private void ShowBookDetails(string bookName)
    {
       //Show Book Details based on Book Name
    }


Hope this will help you.
 
Share this answer
 

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