How do we make a dropdown hidden

Anonymous
2023-09-13T14:12:23.71+00:00

How do we make a dropdown hidden in MVC CORE

For example I want make the Status dropdown hidden

 <div class="form-group">
                <label asp-for="Statusid" class="control-label"></label>
                <select asp-for="Statusid" class="form-control" asp-items="ViewBag.Statusid"></select>
                <span asp-validation-for="Statusid" class="text-danger"></span>
            </div>

Capturereadonly.JPG

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,564 questions
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 65,556 Reputation points
    2023-09-13T15:17:04.2133333+00:00

    Just replace the code with:

    <input type=“hidden” select asp-for="Statusid" />

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.