Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HTML
@Html.BeginForm("ShowDetails", "Home", new { id="opt1"})
@*@Html.DropDownListFor(m => m.FirstName, new SelectList(ViewBag.ListContact));*@
<div>
<select id="Select1">
    @foreach(var c in Model)
    { 
    <option value="@c.IdContact" id="opt1">
        @c.FirstName   @c.LastName
    </option>
        
    }
</select>
    <input type="submit" onsubmit="" />
    </div>
Posted
Updated 1-Nov-15 7:04am
v2
Comments
Krunal Rohit 1-Nov-15 13:05pm    
Elaborate your question more.

-KR

1 solution

You can set the value in Viewbag and refer it in BeginForm
HTML
Html.BeginForm("ShowDetails", "Home", new { id = ViewBag.IdContact })
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900