DmitryEfimenko / TwitterBootstrapMvc

Fluent implementation of ASP.NET-MVC HTML helpers for Twitter Bootstrap.
Apache License 2.0
223 stars 79 forks source link

EditorFor bug #432

Closed larosel closed 8 years ago

larosel commented 8 years ago

@f.FormGroup().EditorFor(model => model.title) use ViewBag.Title

@f.FormGroup().TextBoxFor(model => model.title) is ok

DmitryEfimenko commented 8 years ago

What is your question?

larosel commented 8 years ago

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

DmitryEfimenko commented 8 years ago

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.