Dropdowns not updating correctly - ASP.NET Forums:: When I edit Issues I get a drop down of projects so I can assign an issue to a I really love the out of the box functionality of dynamic data. http://forums.asp.net/t/1195935.aspxHOME | I need to make dynamic dropdown boxes to embed in a dynamic grid. The
grid is working. I have tried two approaches to the dropdown boxes
(independent of the grid) to no avail. One approach was straight ASP
and the other was ASP & JavaScript. I am using MS SQL Server 2000.
Table structure:
tbl_product_line
product_line_id (numeric, 9, identity)
product_line_name (varchar, 50)
division_id (numeric, 9)
status_id (numeric, 9)
date_added (smalldatetime, 4, getdate())
tbl_product_category_lu
product_category_id (numeric, 9, identity)
product_category_name (varchar, 50)
product_line_id (numeric, 9)
division_id (numeric, 9)
status_id (numeric, 9)
date_added (smalldatetime, 4, getdate())
Obviously, the tables are linked on:
tbl_product_line.product_line_id =
tbl_product_category_lu.product_line_id
That being said, I want the first dropdown box to list all values
associated with tbl_product_line.product_line_name. The next dropdown
box should list all values associated with
tbl_product_category_lu.product_catgegory_name filtered on the first
choice. Example:
Prod_Line dropdown box choices:
A, B, C
For the second dropdown box:
If Prod_Line choice A, then Prod_Cat_Name = prod1, prod2, prod3
If Prod_Line choice B, then Prod_Cat_Name = prod21, prod25, prod36
If Prod_Line choice C, then Prod_Cat_Name = prodC, prod44, prodD
My preference is to have all code in ASP and not reload the page.
However, time is of the essence and I am open to suggestions. CodeProject: Dynamic DropDown Properties on the PropertyGrid. Free :: ASP. ASP.NET. ASP.NET Controls. ATL Server. Caching. Charts, Graphs and that the PropertyGrid should display these values within a dropdown combo box. http://www.codeproject.com/KB/cpp/DynamicDropDownProperties.aspxHOME | ASP.NET : Using a Grid to Display Detail Information:: ASP NET 2 0 Free Tutorials Using a Grid to Display Detail Information In this tutorial you will learn how to use a GridView Control to display the details of the http://www.exforsys.com/tutorials/asp.net-2.0/asp.net-2.0-using-ay-detail-information.htmlHOME |
Here is a nice article that shows the client side JavaScript for
conditional dropdown boxes.
http://forums.devshed.com/t14074/s.html
It should be fairly straightforward to add the data from your database
to the html forms.
Good luck!
Chris
First, write a function to create the first dropdown box. This
function should take the relevant id as an argument and print the
HTML. Then, write a similar function for the second dropdown box.
One way to do this would be to have each function accept as a second
argument a string that you will use to name the form code or
javascript that you will need to use to handle what happens if the
user selects one of the items in the dropdown box. I would probably
recommend javascript for this rather than trying to do it all on the
server side, since it can be done rather simply with one javascript
function that is called when the onchange event fires for one of the
dropdown boxes, or the onclick event fires for a button used to
navigate based on the selections made.
As an alternate approach, you may try doing this using web forms
(.net). It has some widgets (datagrids) that are designed to make
what you're trying to do very easy and modular. ASP.NET Dynamic Data Field Templates Overview:: ASP.NET Dynamic Data field templates are ASP.NET user controls that map data of the category ID, provide a drop-down list box in edit mode, and link to other http://msdn.microsoft.com/en-us/library/cc488523.aspxHOME |
Earnings Reports a Tonic for Ailing 'Net Stocks
NatWest and InterTrust Form Global Alliance To Provide E-Commerce On the Internet |