So i'm retrieving menu from database using GenericHandler. This works fine but i need to resolve the Url since from of the links are not in the same folder. Here is a little code .
what is need to resolve is the "this.Url" which is been returned from my Generic Handler class. Anyway round this please??
<script type="text/javascript"> $(document).ready(function () { $.ajax({ url: "<%: ResolveUrl("~/MenuHandler.ashx")%>", method: 'GET', dataType: 'json', success: function (data) { buildMenu($('#menu'), data) $('#menu').menu(); } }); function buildMenu(parent, items) { $.each(items, function () { var li = $('<li class="treeview"><a href="' + this.Url + '"><span>' + this.MenuDescription + '</span><span class="pull-right-container">^__i class="fa fa-angle-left pull-right"><i/></span></a></li>'); li.appendTo(parent); if (this.List && this.List.length > 0) { var ul = $('<ul class="treeview-menu"></ul>'); var newli = $('<li></li>') ul.appendTo(li); buildMenu(ul, this.List); } }); } }); </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)