I have a database and I am using the Entity Framework with Linq 2 Enities. I am working with ASP.NET MVC 2.
I have a database with two tables as shown bellow:
Classifieds Catergories
ID(PK) CatID(PK)
CatID(FK) CatName
Desc
...
Obviously when the user adds a new classified and when they come to pick the category they don’t want to see CatID’s so my question is this. How do I let the user add a classified by selecting the CatName?
I am using strongly typed views. Restructuring the database is out of the question. Answer in C# please.
Thanks,
I have come up with this solution:
Controller:
View:
And that is it dead simple and it works fine!