@moelname
@{
Layout = "";
}
<input type="hidden" id="" value="@Model.modelproperty" />
here value not coming give your suggestions
@moelname
@{
Layout = "";
}
<input type="hidden" id="" value="@Model.modelproperty" />
here value not coming give your suggestions
This should be sufficient
Model
public class MyModel
{
public bool MyBool { get; set; }
}
Controller
public ActionResult MyController()
{
return View(new MyModel {MyBool = true});
}
View
@model MyModel
<input value="@Model.MyBool.ToString()" />
You need to use @Model.modelproperty.ToString() to get it right. Please refer this: ASP.NET MVC 5 renders different bool value for hidden input