-1

I am working on a website i.e a tours and travel website in which I have been stuck at a place where I need to show up an image when a option is selected in drop down list and the image is retrieved from database and the image is stored in binary data and also the data value of drop down list is retrieved from database so I wanted to display the image as soon as the option is selected in drop down list .Below is the database I have created:

This is the Image of the database from which I want to retrieve image and subcatname in dropdown list

Form Image:

Image of the form on which i want to retrieve image and subcatname in dropdown list

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
  • you should check that post : http://stackoverflow.com/questions/2965971/how-to-add-a-images-in-select-list – Hans Feb 09 '17 at 08:28

2 Answers2

0

Assuming that u are using webforms, Follow the Steps :

  • Add Eventlistener onDropdownSelectionChanged

In event Listener -

  • Fetch Using id from Database

  • Get the ImageButton / Tag

  • Convert to image and save in temp path

  • Display By Setting ImageUrl Property

Faizal Shap
  • 1,680
  • 1
  • 11
  • 26
0
        if (DropDownList1.SelectedValue == "value 1")
        {
            Image1.ImageUrl = "images/image-1.png";
        }
        else if (DropDownList1.SelectedValue == "value 2")
        {
            Image1.ImageUrl = "images/image-2.png";
        }

        ...
        ...
        ...

        else
        {
          Image1.ImageUrl = "images/image-n.png";
        }