I have this
<div class="mb-3">
<label asp-for="DeliveryDt" class="control-label"></label>
<input asp-for="DeliveryDt" type="text" class="datepicker form-control" autocomplete="off" autofocus="true" readonly />
<span asp-validation-for="DeliveryDt" class="text-danger"></span>
</div>
i want to hide this field from my razor view.but i have no idea. In Asp.net simple we Visible = 'False' ,but this is not working in .Net core 6 MVC please show me idea except $('#DeliveryDt').hide();
I have tried this $('#DeliveryDt').hide(); this is working but it only hides textbox ,label is still dispalying as it is.
please share some idea except jquery or javascript.
You can use css
display: none:If you want to optional control the div visible by backend, you could define a property in your model.
Model
View
use if statement
Or you can use css
Controller