i have an asp.net mvc application in which i have this Model:
public class Vehicule
{
private string matricule;
private int id_vehicule;
private string type;
private string chauffeur;
public int Id_vehicule
{
get { return id_vehicule; }
set { id_vehicule = value; }
}
public string Matricule
{
get { return matricule; }
set { matricule = value; }
}
public string Type
{
get { return type; }
set { type = value; }
}
public string Chauffeur
{
get { return chauffeur; }
set { chauffeur = value; }
}
}
in my view i'd like to replace this snippet:
<select name="id_vehicule" >
@foreach(Vehicule v in Model.GetVehicleList()){
<option value="v.Id_vehicule">v.Type</option>
}
</select>
by another code using the html helpers Html.ListBox or Html.ListBoxFor.
How can i modify my code to do this task?