So my situation is that I am populating a model based on a text box in my view. My code is this
View:
@model LiteModel
@using (Html.BeginForm())
{
<label>Lite ID</label>
@Html.TextBoxFor(model => model.LiteId)
<br />
<label>Width</label>
@Html.TextBoxFor(model => model.BaseSize);
<br />
<label>Height</label>
@Html.TextBoxFor(model => model.HeightSize);
<br />
<input type="submit" class="right" />
<br />
}
Controller:
[HttpPost]
public IActionResult Index([FromForm]LiteModel model)
{
model = LoadLiteInfo(model);
return View(model);
}
Model:
namespace LiteViewer.Models
{
public class LiteModel
{
public string LiteId { get; set; }
public string ShapeId { get; set; }
public double BaseSize { get; set; }
public double HeightSize { get; set; }
}
}
Now I know the LoadLiteInfo method works as its supposed to, it populates the model object just as it should. For some reason however the changes in the model are not being reflected in the view. I cant for the life of my figure out why its not working.