0

I have Two Tables in an Access Database:-

TABLE1, Has only one column and is the primary key, each record must be unique.

TABLE2 will be CAR MODELS and will have two Columns which are CAR_MANUFACTURER && CAR MODEL. In this table CAR_MODEL IS UNIQUE. The relationship between the two tables is 1 TO MANY between the CAR_MANUFACTURER && CAR_MODEL.CAR_MANUFACTURER.

E.G

TABLE1
---------------
MANUFACTURER
----------------
NISSAN
FERRARI
PORSCHE
FORD

TABLE2
-----------------------------
CAR_MANUFACTURER : CAR_MODEL
-----------------------------
NISSAN           : Almera
FERRARI          : Testarossa
PORSCHE          : 911
NISSAN           : Juke
NISSAN           : Quashqai
PORSCHE          : Carrera
FERRARI          : F30

I can pull the data out of the database using ADO.NET, and convert each table to SelectedItemList[] objects.

But I cannot figure out how i am to filter between these select lists in my View.

The first dropdownlistfor will have the Text & Value Property both Set at the same Value, "Car Manufacturer".

Its the second dropwdownlistfor that I am puzzled by.

If i set the Text property to "CAR_MODEL" and the value to "CAR_MANUFACTURUER", then I will be able to filter the data with a Jquery, something i haven't figured out yet.

But I have a property in my Model for this view , that I need to feed back the "Car Model" value, How would I do this when the dropdownlistFor Value property is set at "CAR_MANUFACTURER" in table 2 in order for the filter to work?

I apologise in advance for the insane description of my problem, but I'm getting further away from resolving this problem than fixing it at present. I can not get my head around it. I am new to ASP.NET MVC3.

4

0 回答 0