Tuesday, 12 January 2021

MVC - get selected value from disabled drop down list

 

 Watch this example on YouTube



to view selected value of disabled drop down list in controller 

add it to hidden in View 


@using (Html.BeginForm("Index", "Home"))
{
    @Html.HiddenFor(x => x.or.ProductID)
    @Html.DropDownListFor(x=>x.or.ProductID, new SelectList(Model.prod,"ProductID", "Name"), new { @id = "myID" })

    <input type="submit" class="submit" value="Submit" />

}

No comments:

Post a Comment