Watch this example on YouTube
 @using (Html.BeginForm("Index", "Home"))
{
    @Html.DropDownListFor(x=>x.or.ProductID, new SelectList(Model.prod,"ProductID", "Name"), new { @id = "myID" })
    
}
<input type="submit" onclick="DoSomething()" value="Clear Drop Down List" />
@section Scripts{
    <script type="text/javascript">
         function DoSomething(){
            $("#myID").empty();
        }
    </script>
    }
 
No comments:
Post a Comment