Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. How to set the value for dropdownlist of AJAX autocomplete control?

How to set the value for dropdownlist of AJAX autocomplete control?

Scheduled Pinned Locked Moved Web Development
databasehelptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vicky457
    wrote on last edited by
    #1

    Hi, I am using Microsoft AJAX autocomplete to lookup some product from database. I am wondering if it's possible to access onSelected event of the dropdownlist. Actually, what I want to do is only display product name in dropdownlist, and keep product ID in value field of the dropdownlist. When a user select an item from the dropdownlist, I will retrieve the product ID from the dropdown control for futher action. But since the webservice only return one string and that string is populated into dropdownlist automatically. I couldn't find how to set the text and value for dropdownlist using diffrerent values.... Did anyone have idea how to achieve it? Any help would be really appreciated! Thanks!

    N 1 Reply Last reply
    0
    • V vicky457

      Hi, I am using Microsoft AJAX autocomplete to lookup some product from database. I am wondering if it's possible to access onSelected event of the dropdownlist. Actually, what I want to do is only display product name in dropdownlist, and keep product ID in value field of the dropdownlist. When a user select an item from the dropdownlist, I will retrieve the product ID from the dropdown control for futher action. But since the webservice only return one string and that string is populated into dropdownlist automatically. I couldn't find how to set the text and value for dropdownlist using diffrerent values.... Did anyone have idea how to achieve it? Any help would be really appreciated! Thanks!

      N Offline
      N Offline
      newc1
      wrote on last edited by
      #2

      Hi, The AutoCompleteExtender control was not really designed to be used with a DropDownList, as it can only return a string array to the client. If using a TextBox, as oppossed to a DropDownList, is not a viable option for you then you may need to look at writing a custom control that extends the functionality of the AutoCompleteExtender to return name/value pairs.

      Clean code is the key to happiness.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups