Advice needed for dropdownlistbox selecting items

Discussion in 'C#' started by leon25, Dec 8, 2009.

  1. #1
    I have a table containing three fileds Name , city, Marks

    If I select name filed in dropdownlist box i want the rest of the fields to be displayed in Text boxes

    Thanks in advance.
     
    leon25, Dec 8, 2009 IP
  2. perfect101

    perfect101 Greenhorn

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    Is the data being pulled from a database? If so your going to need to take a look at ajax and javascript to populate the text fields.

    http://www.w3schools.com/Ajax/ajax_example.asp
     
    perfect101, Dec 9, 2009 IP
  3. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #3
    You don't need to use AJAX, but it would be suitable.
    If your using ASP.NET, just add an event to the dropdownlist 'OnSelectedIndexChanged'... and add code that populates the textboxes with the data from database, I'm assuming your using a database.
     
    camjohnson95, Dec 14, 2009 IP
  4. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #4
    If you need more help then please provide the code that you have....
     
    camjohnson95, Dec 14, 2009 IP
  5. pom4ik

    pom4ik Greenhorn

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    16
    #5
    or load every thing into javascript and change the values of the text boxes using javascript ...

    AJAX or using the event handler would be much easier and cleaner
     
    pom4ik, Dec 15, 2009 IP
  6. makeitlive

    makeitlive Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    loading all values to javascript and simply changing the values would do the job, however the bigger your database the bigger the javascript would be and therefore would need more time to load.

    I would recommend using AJAX for that.
     
    makeitlive, Dec 21, 2009 IP
  7. sauravmandhotra

    sauravmandhotra Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    create a method whici will store information,bind the ddl with object data source and then show in ur textbox
     
    sauravmandhotra, Aug 1, 2010 IP