Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 9th, 2005, 01:56 PM
Authorized User
 
Join Date: Dec 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shankhan Send a message via Yahoo to shankhan
Default How to populate list item

I have two list item on same page and both are getting list from two different tables in database. One list item is showing the brand like HP, Compaq, Acer .... and other list is showing the categories like Server, Workstation, Monitor, Thumb Digitizer ....
Now i want that when user select a brand from one item list, at his/her selection other item list only show those categories which are related with that brand. both tables are joined at brand_id. I'm working in VBScript currently. is there any solution?

Thanx

 
Old March 9th, 2005, 02:16 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Only populate the Brands list first. Then get the selected item(s), and pass as a parameter.

Ex. Select <columns> From <table> Where brand_id = <selected id(s) in list>

Then use that result set to populat your categories list.


 
Old March 11th, 2005, 01:15 PM
Authorized User
 
Join Date: Dec 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shankhan Send a message via Yahoo to shankhan
Default

1- dear i'm confuse that how i implement it. look i have to record sets which are populating to list items on a same page. one recordset is "select brands from product" populating list item "brand" while other recordset is "select categories from product" populating list item "categories". but i want that when user select brand from brand list item page refresh and show only the categories which r related with that brand so i'll replace second query with "select categories from product where brand = '" & BrandVariable &"'"
but for this i have to press submit button. i don't want to use submit button. i need when user select brand page should refreshe on select.

2- the second think, i have created a link on for example "Item". when user click on "item" it executes a query and shows the specification of that item on next page. is it possible that when user click on "item" a popup windows should appear and show the result of that query in that popup window.

i hope u can understand my problems

thanx

 
Old March 12th, 2005, 03:00 AM
Authorized User
 
Join Date: Mar 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default



Hy,

For 1 : wot u can do is to execute query for populating
the second list on the First list's 'selected index changed' event.

 
Old March 22nd, 2005, 01:23 PM
Authorized User
 
Join Date: Dec 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shankhan Send a message via Yahoo to shankhan
Default

can any1 plz write a sample code that how can i populate second list on 'selected index changed' event. i shall be very thankful.
Zee

 
Old March 23rd, 2005, 04:03 AM
Authorized User
 
Join Date: Mar 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hy..

1) on page load event populate ur first list by using query
like this one--"qu = "select brand_name from Brands""
2) on selected index changed property of first list populate the
2nd list by using a query sumwot like this one--
"qu = "select category_name from categories where brand_id = select brand_id from brands where brand_name='" & ddl1.SelectedItem.Text & "')""

3) bind ur 2nd list.

hope this helps.. !:)

Ciao..
It bcums FATAL wen my brain puts my eyes on Call-Waiting ! >|B-)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate drop down list with XML file rlull ASP.NET 1.0 and 1.1 Basics 5 November 30th, 2013 12:15 PM
Populate a list box from comma separated values CoderNH Access VBA 3 October 20th, 2008 08:37 AM
populate a drop list fro a data table greenbriar ADO.NET 2 July 22nd, 2008 10:18 PM
Get the first item of a List hpox ASP.NET 2.0 Basics 1 February 16th, 2007 06:04 PM
populate drop down list with a function code3hree Javascript 1 May 28th, 2005 11:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.