Results 1 to 4 of 4

Thread: Easy Question

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    49
    I am a VB programmer that has gone headfirst into ASP / VBScript.

    I have a webpage with a combo list box (populated from querying a database) and a treeview control. I can get the individual elements to work in isolation, but how do I use the value of the combo box as a parameter for the query populating the treeview control?

    Can I just reference it direct or do I have to submit it via a form.....

    I am using the SAMS Learn ASP in 24hrs - can anyone recommend a better book?

    Thanks

    Ian

  2. #2
    Guest
    First on the book thing: I followed the same route as you did, also from VB programming into ASP and VBScript, and I used the book called "Professional Active Server Pages 2.0" (ISBN: 1-861001-26-6) and found it quite usefull.

    As for your question: I've been out of actual VB (and treeviews and all) for too long now to remember the fine details about it, but if you wanna get data from a control on a page to use for another control in that same page, you either have to call that page again and get the data from the form you submitted, or you have to do something using DHTML and Javascript (anybody correct me if I'm wrong, please).

  3. #3
    Addicted Member
    Join Date
    Jun 2000
    Location
    Pittsburgh, PA
    Posts
    149
    no, your pretty much right if he's using an html page. If its an ocx control he could trigger an event on the page and would then run whatever javascript he wants for it. Ass far as how to do it im not exactly sure but there is info about it somewhere.

  4. #4
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    You have to keep in mind the separation between client side and server side. Any query to the database is on the server side, and any interaction with controls whether they are ActiveX controls or HTML form objects, is done on the client side. The only way to accomplish a change in the actual query, would be to refresh or reload the page with a querystring.

    Now, if you have a relatively small set of data, you can populate an array in client side Javascript by using Response.Write to create the client side scripts and populate the arrays. Then in the onChange() events for the dropdown, you can repopulate the other controls from the client side arrays without another round trip to the server.

    BTW- The book on ASP from Wrox press is excellent if you already know VB.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

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



Click Here to Expand Forum to Full Width