<!-- Sidebar --> <div class="sidebar navbar-collapse" id="divMainMenu" ng-if="'@ViewBag.ShowMenu'"> <!--- Sidebar navigation --> @Html.Action("MainMenu", "Menu", new { area = "" }) </div>I can see that @ViewBag.ShowMenu = false at the time the code is running. However, the MainMenu is still executing. What should I do to prevent its execution in that case completely?