Cracking my head with MVC here.
I've written my model as:
public class AboutModel
{
public string AboutText { get; set; }
}
and my controller as:
public ActionResult About()
{
var model = new AboutModel { AboutText = "We build better software."};
return View(model);
}
and changed the new
line to:
AboutModel model = new AboutModel { AboutText = "We build better software."}
and finally to:
dynamic model = new AboutModel { AboutText = "We build better software."}
seems all works perfectly well with my View
:
@model MvcApp.Models.AboutModel
<p>@if (Model != null)
{
@Model.AboutText
}</p>
Any difference on my 3 model Initializations?