0

I am trying to convert one of my cshtml files to phtml. In cshtml we can use html helper library DropDownListFor to create a dropdown and assign a model to get the values from,how do we do the same in magento2

I am attaching my cshtml file below

@model FIDO2FADemo.Models.FidoVerifyModel


@using (Html.BeginForm("VerifyFido", "New", FormMethod.Post, new { role = "form", id = "formFido" }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(false, "", new { @class = "text-danger" })
    @Html.HiddenFor(model => Model.UserID)
    @Html.DropDownListFor(m => m.ID, Model.FidoDevicesSelect, new { htmlAttributes = new { @class = "form-control" } })

}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")

}

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.