I am not sure if I am overlooking something obvious. Once I do a POST, I have the following (Note: What I am trying to do is to default the same view with some null values so the user can create another entry):
[HttpPost]
public ActionResult QkInsert(ProgInfo model)
{
if (ModelState.IsValid)
{
ProgService.InsertQuickEntry(model);
model.Name = null;
model.Address = null;
model.Phone = null;
return view(model);
}
return view(model);
What is strange is that when I look at the value of model in the IsValid()
return view(model)
I do see the null values. But when it is shown on the view, it is not null. It is basically the same view as when I had entered the data the first time. Any idea? Have I overlooked something?
Also notice how I have done return view(model) twice. Is there any other way of doing this to where I do it only once and not repeat?