TargetId in EJ 1 ASP.NET MVC NavigationDrawer

23 Aug 2017 / 1 minute to read

This property is used to define the target Id for Navigation Drawer. The drawer opens while you click on the specified target element.

  • cshtml
  • @{
    
    @Html.EJ().Button("drawerTarget").Text("Open Drawer")
    
    @Html.EJ().NavigationDrawer("navigationPane").Width(300).TargetId("drawerTarget").ContentTemplate(@<div>
    
    @Html.EJ().ListView("list").Width(300).Items(items =>
    
     {
    
    	 items.Add().Text("Home");
    
    	 items.Add().Text("Profile");
    
    	 items.Add().Text("Photos");
    
    	 items.Add().Text("Location");
    
     })
    
    </div>)
    
    }
    
    <style>
    
        #drawerTarget {
    
            top: 200px;
    
            left: 600px;
    
            position: absolute;
    
        }
    
    </style>

    The following screenshots illustrates the output.

    TargetId_img1

    TargetId_img2