Hi, I think this question has been asked before but I can't work
out from other answers how to make mine work from it. I know next to
nothing about Jquery but have the below script on an ASP.NET MVC 5
_Layout page
- <script>
-
$(document).ready(function () {
-
$(".treeview li>ul").css('display',
'none'); // Hide all 2-level ul
-
$(".collapsible").click(function (e) {
-
e.preventDefault();
-
$(this).toggleClass("collapse expand");
-
$(this).closest('li').children('ul').slideToggle();
-
});
-
});
-
</script>
This works with a Html.RenderAction on the _Layout page that gets
the data from a Sql database to populate the treemenu,
All works ok, but when I click a link on the tree menu to render a
new body content page the tree menu collapses. Is there an easy way
to add something that will maintain the tree menu state?
Please feel free to dumb down the response as this area really
isn't my strong point!
Thanks