How to repopulate a dropdown list without posting back?

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default How to repopulate a dropdown list without posting back?

    I have two dropdown list(ie State and Region) that are populated with
    data from database.
    I want to repopulate the second dropdown list(Region) according to what
    state user has selected without posting back to the server.

    How do I implement this?

    Thanks a lot in advance.




    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    TaeHo Yoo Guest

  2. Similar Questions and Discussions

    1. GridView Control is not posting back correctly
      Hi All I am using ASP 2 in VS 2005.net beta 2. I am using a gridview and have bounded it with datatable. I have added dropdownlist to the...
    2. Dropdown list
      I would like to display 15 items (lines) in the dropdown list, but by default the list displays only 11 lines. How can I have all the 15 items...
    3. Posting data back to a modal dialog window
      Hi all, I have a modal dialog window from which a user selects a few rows from a datagrid and then clicks on an image button. My question is...
    4. Weekly list FAQ posting
      NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <org> ...
  3. #2

    Default Re: How to repopulate a dropdown list without posting back?

    Hi,

    You should get all the data to the client (you can use XML islands[1])
    and then use java script and the DHTML objects[2] to clear the list and
    add new items to the list[3] or just change the inner html.

    [1] -
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk3[/url]
    0/htm/xmconxmldataislands.asp
    [2] -
    [url]http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml[/url]
    /reference/objects.asp
    [3] -
    [url]http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml[/url]
    /reference/objects.asp

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

  4. #3

    Default Re: How to repopulate a dropdown list without posting back?

    Cut and paste the two parts of the URL to the explorer.

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!

    Natty Gur Guest

  5. #4

    Default Re: How to repopulate a dropdown list without posting back?

    The URLs are wrapped on the lines. Make sure you get the whole address. They
    work fine.

    "TaeHo Yoo" <yootaeho@yahoo.com> wrote in message
    news:enOhOLNUDHA.1740@TK2MSFTNGP12.phx.gbl...
    > Thanks Natty Gur for your advice.
    > However, none of links you provided work.
    > Could you tell me again?
    >
    > Appreciate.
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Brock Guest

  6. #5

    Default Re: How to repopulate a dropdown list without posting back?

    You can do it in this way.

    1. Put all your functionality for getiing the data of your second drop
    down in an ASPX page, and return the results as a XML content.
    2.Create an XML DOM object on the client side and load the aspx page
    into that object. You can also pass the query string.
    Ex: xmlDocObj.load("yourpage.aspx?querystring=value);
    3. Now you have all the data for the second drop down in the xml
    object on the client side.
    4. Parse through the XML object and populate the drop down.

    Thanks
    Ram Pabbaraju

    TaeHo Yoo <yootaeho@yahoo.com> wrote in message news:<#fqR1DMUDHA.612@TK2MSFTNGP12.phx.gbl>...
    > I have two dropdown list(ie State and Region) that are populated with
    > data from database.
    > I want to repopulate the second dropdown list(Region) according to what
    > state user has selected without posting back to the server.
    >
    > How do I implement this?
    >
    > Thanks a lot in advance.
    >
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!
    Ram Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139