Closed larosel closed 8 years ago
What is your question?
ok. well @model MasterServer.Models.EventHottimeModel
@{ ViewBag.Title = "Details"; }
@Html.Bootstrap().FormGroup().DisplayFor(m => m.title)
model.title is "hottime event" but
showing "Details" - this not model.title. this is ViewBag.title
Showing ViewBag.Title instead of Model.Title when i use DisplayFor and EditorFor. But. DisplayTextFor, TextBoxFor showing Model.Title. this correct.
ViewBag.Title = "Details", @Model.Title = "hottime event" DisplayFor(m => m.title) shows "Details", DisplayTextFor(m => m.title) shows "hottime event"
it's a bug when use variable name "title" in model
People have experienced similar thing in MVC projects in general. Fixing it is very time intensive and just isn't worth it given that there is a simple workaround: just use a different property name.
@f.FormGroup().EditorFor(model => model.title) use ViewBag.Title
@f.FormGroup().TextBoxFor(model => model.title) is ok