Using Dropdown Lists and Postback VB .net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stinger5900
    New Member
    • Feb 2008
    • 4

    Using Dropdown Lists and Postback VB .net

    I have 4 ddlist's. ddlist a, b,c,d.

    list a selects a database in a file
    list b selects a table
    list c selects a date in the table
    and d selects a second value in the table

    I would like ddlist a to post back and update ddlist c and ddlist d
    I have ddlist b doing just that, but ddlist a will not it will post pack and reload the page however c and d will not update unless I change ddlist b

    I am using vb code .net asp 2.0 and Access data base objects.
    Is there a way to force ddlist c and d to refresh when ddlist a selected index is changed.
  • harshmaul
    Recognized Expert Contributor
    • Jul 2007
    • 490

    #2
    Hi,
    Set the autopostback property to all of the DDLists as true,

    then on the DDL's selecteditemind exchanged event fill the next list.

    I can give example code tomorow if you like.

    Comment

    • kunal pawar
      Contributor
      • Oct 2007
      • 297

      #3
      can u post ur code, and can u tell us u set property AutoPostback of drop down box to true

      Comment

      • stinger5900
        New Member
        • Feb 2008
        • 4

        #4
        Yes the Auto post back is true. I think is has something to do with the fact that the access data object is linked between ddlist b, c, and d. What i mean is in the SQL statement ddlist C get a value from b and ddlist d has an SQL statement that gets a value from ddlist c, however ddlist A sets the datafile property of the two access objects.

        below is where ddlist a text is getting the used as "DatabaseRecord "
        Dates.DataFile = Profile.DataBas eLocation & Session("Databa seRecord") & ".mdb"

        info.DataFile = Profile.DataBas eLocation & Session("Databa seRecord") & ".mdb"

        Where the SQL statement is
        select * from table where ddlist c value is like date and ddlist d value is like data.

        Is there a way to force the drop down list to data bind?

        Comment

        Working...