sudheen

sudheen

  • 1.4k
  • 313
  • 83.7k

MVC Dynamic Menus

May 20 2015 8:00 AM
hi guys,
below code snippet what is  title="@Description"
can anybody give explanation or why do we need.. 
 
 
 
@{
02 List<Menus> myMenu = MyMenu.GetMenus();
03 var plist = myMenu.Where(m => m.ParentID ==null).ToList(); // This will list main menu items on which we'll apply loop to display them.
04 if (plist != null && plist.Count > 0)
05 {
06 <ul class="nav">
07 @foreach (var pitem in plist)
08 {
09 <li>
10 <a href="{URL-Required} title="@Description">@pitem.Title</a>
11 @{
12 var clist = myMenu.Where(m => m.ParentID == pitem.ID).ToList();
13 if (clist != null && clist.Count > 0)
14 {
15 <ul>
16 @foreach (var citem in clist)
17 {
18 <li><a href="{URL-Required}"title="@Description">@citem.Title</a></li>
19 }
20 </ul>
21 }
22 }
23 </li>
24 }
25 </ul>
26 }
27}
 
 
 
 

Answers (2)