如何在MVC 5中生成DropDown列表? [英] How to generate the DropDown List in MVC 5?

查看:98
本文介绍了如何在MVC 5中生成DropDown列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有三张桌子 BillingHead BillingType BillingSubType 的。所有他们分别 ID 作为主键和名称。 BillingHeadID 是用于 BillingType 表约束的外键 BillingTypeID 外键 b> BillingSubType 的约束。



现在我想要一个 BillingHead 名称的下拉列表进入创建 查看 结算类型结算类型名称进入 BiullingSubType



我使用的是MVC 5和EntityFramework6。并且还使用数据库第一种方法。

Hello to all,

I have three tables as BillingHead, BillingType, BillingSubType. All they have ID`s as primary key and names respectively. BillingHeadID is an foreign key for constraint for BillingType table, and BillingTypeID is an Foreign Key Constraint for BillingSubType.

Now I want an dropdown list of BillingHead names into Create View of Billing Type and BillingType name into BiullingSubType.

I am using the MVC 5 and EntityFramework6. And also using database first method.

推荐答案

尝试浏览以下链接 -

http://www.c-sharpcorner.com/UploadFile/4b0136/working-with-dropdownlist-in-mvc- 5 / [ ^ ]

http://www.asp.net/mvc/tutorials/javascript/working-with-the-dropdownlist-box-and-jquery/using-the -dropdownlist-helper-with-aspnet-mvc [ ^ ]

http://codeclimber.net.nz/archive/2009/08/05/how-to-create-a-dropdownlist -with-asp.net-mvc.aspx [ ^ ]
Try going through the following links -
http://www.c-sharpcorner.com/UploadFile/4b0136/working-with-dropdownlist-in-mvc-5/[^]
http://www.asp.net/mvc/tutorials/javascript/working-with-the-dropdownlist-box-and-jquery/using-the-dropdownlist-helper-with-aspnet-mvc[^]
http://codeclimber.net.nz/archive/2009/08/05/how-to-create-a-dropdownlist-with-asp.net-mvc.aspx[^]


这篇关于如何在MVC 5中生成DropDown列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆