@{
foreach (var item in ViewBag.CategorysList)
{
<ul id="nav" class="dropdown dropdown-vertical">
<li class="menu"><a href="#" onclick="type('@item.Category')">@item.Category </a>
</li>
</ul>
}
}
<script type="text/javascript">
function type(Category) {
$.post("/Book/Nookname", { name: Category}, function (result) {
$("#ty").html(result);
})
}
</script>
public ActionResult Nookname()
{
BooksBll booksbll = new BooksBll();
string lei = Request["name"];
List<BookTable> booktable = booksbll.Message(lei);
ViewBag.Users = booktable;
return View();
}