Jump to content

DropDownList list from an id value


wrb

Recommended Posts

How can I make the DropDownList appear only item from a particular id = Med_Produto?

Controller:
ViewBag.cod_Med= new SelectList(db.Prod_Med, "id", "descricao");
View:
@Html.DropDownList("cod_Med", null, String.Empty, new { id = "Med_Produto", name = "cod_Med", @class = "form-control" })
Example: id> 38
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...