0
我有一個菜單的局部視圖,根據當前的行動我想顯示或隱藏鏈接,我在此嘗試以下獲取局部視圖當前的操作和運行的jQuery
@if (ViewContext.Controller.ValueProvider.GetValue("action").RawValue.ToString() == "Users")
{
<script>
$("#addVS").show();
</script>
}
<li>@Html.ActionLink("Users", "Users", "Users")
<ul id="addVS" style="display:none;">
<li>@Html.ActionLink("Add New User", "AddEditRecord", "Users",new { mode = "null"}, new { @id = "openDialog" })</li>
</ul>
</li>