Saturday, 15 June 2013

asp.net mvc - MVC 4 TreeView Menu -


I tried to follow it, because it was cited as an example in many places:

< P>

) {MenuDBContext db = new menu dbctext (); ViewData ["AllMenu"] = DB. Menu .Oolist (); See refund (db.Menus.ToList (). Where (C => c. PID == faucet)); }

View category:

  @ {ViewBag.Title = "index"; } @model iInmerebel & lt; Geo.Models.Menu & gt; & Lt; H2 & gt; Index & lt; / H2 & gt; @ Varic (Miscellaneous items in the model) {& lt; Li & gt; @item @ {var kids = watchdata ["allmenu"]. Where (C => C.PID == item.ID);} if (kids.count ()> gt; { ul & gt; @ {Html.RenderPartial ("ItemControl", children) ;}  gt;}   

I can not work for my life because I can not use it. Where children About "View" ["AllMenu"] or any device, where I am going wrong, it will be fantastic. "post-text" itemprop = "text">

IEnumera as "videadata [" allmenu "] as IEnumerable & lt;

  var kids = (ViewData [" AllMenu "]) Ble & gt; GeomantApp.Models.Menu & gt;) where (C => C ....   

data dictionary & lt; string, object & gt; , so when you try and obtain a property from that dictionary, then there is no way to know that ASP.NET is what it is before hand if you do not put your object first Compiler errors.

No comments:

Post a Comment