I created a model and i am trying to build something like when i click on submit button the values should be passed to controller which looks like
[HttpPost]
// i am getting checked property but not phoneno to controller
public ActionResult Confirm(Entity s)
{
return view();
}
My View
@model MvcApplication3.Models.Entity
@using ( Html.BeginForm("Confirm", "Home", FormMethod.Post))
{
@Html.CheckBoxFor(m=>m.checkedprop,
new
{
@class = "myCheckBox",
phoneno= "1234" //tried different ways none looks working for me
})
<input type="submit" id="ConfirmButton" />
}
Model
public class Entity
{
public bool checkedprop { get; set; }
public int phoneno { get; set; }
}