ASP.NET MVC ViewData (using indices) -
i had working solution using asp.net mvc preview 3 (was upgraded preview 2 solution) uses untyped viewmasterpage so:
public partial class home : viewmasterpage
on home.master there display statement this:
<%= ((genericviewdata)viewdata["generic"]).skin %>
however, developer on team changed assembly references preview 4.
following this, code no longer populate viewdata indexed values above.
instead, viewdata["generic"] null.
as per this question, viewdata.eval("generic") works, , viewdata.model populated correctly.
however, reason solution isn't using typed pages etc. because kind of legacy solution. such, impractical go through large solution , update .aspx pages (especially compiler doesn't detect sort of stuff).
i have tried reverting assemblies removing reference , adding reference preview 3 assembly in 'bin' folder of project. did not change anything. have tried reverting project file earlier version , still did not seem fix problem.
i have other solutions using same technique continue work.
is there can suggest why has stopped working , how might go fixing (any hint in right direction appreciated)?
we made change because wanted bit of symmetry [] indexer. eval() method uses reflection , looks model retrieve values. indexer looks @ items directly added dictionary.
Comments
Post a Comment