Translate

> > ASP.NET Master Page Active Menu Highlight

ASP.NET Master Page Active Menu Highlight

Posted on Wednesday, October 17, 2012 | No Comments

Use this course on you child page content place holder

<script language="javascript">
        document.getElementById("setupmenu").className = "main current";
    </script>

do not use in header contenet place holder , it will generate error.


OR

 Using Jqery in Master page

 <script type="text/javascript">
        $(document).ready(function () {
           
            var pathname = window.location.pathname;
            var index = pathname.lastIndexOf("/");
            var filename = pathname.substr(index + 1);
            $('a[href="' + filename + '"]').attr("class", "main current");

        });
    </script>

Leave a Reply

Powered by Blogger.