How can i keep the selected li menu after postback

I dont speak very well english but I have some listed controls on my aspx form which is as below

here´s the menu:

<div id='cssmenu'>
               <li class='active'><a href=''><span>Inicio</span></a></li>
               <li class='has-sub'><a href='#'><span>Portafolio</span></a>
                     <li><asp:LinkButton ID="LinkResum" runat="server" OnClick="Link_SelectedIndexChanged" 
                     Text="&nbsp;&nbsp;&nbsp;&nbsp;■ Resumen" OnClientClick="Cargar()"></asp:LinkButton></li>
               <li><asp:LinkButton ID="LinkReport" runat="server" OnClick="Link_SelectedIndexChangedReport" 
                     Text="Reporte" OnClientClick="Cargar2()"></asp:LinkButton></li>
               <li class=''><a href='#'><span>Formularios</span></a></li>
               <li><asp:LinkButton ID="LinkButton1" runat="server" OnClick="Link_SelectedIndexChangedContacto" 
                     Text="Contacto" OnClientClick="Cargar3()"></asp:LinkButton></li>
               <li class=''><a href="Javascript:__doPostBack('dnn$dnnLOGIN$cmdLogin','')"><span>Cerrar sesion</span></a></li>

And my jquery is this

here´s my script:

<script type="text/javascript">

$(document).ready(function() {
    $('#cssmenu ul ul li:odd').addClass('odd');
    $('#cssmenu ul ul li:even').addClass('even');
    $('#cssmenu > ul > li > a').click(function() {
        $('#cssmenu li').removeClass('active');
        var checkElement = $(this).next();
        if (('ul')) && (':visible'))) {
        if (('ul')) && (!':visible'))) {
            $('#cssmenu ul ul:visible').slideUp('normal');
        if ($(this).closest('li').find('ul').children().length == 0) {
            return true;
        } else {
            return false;

I want to keep the selected li after postback, im not good jquery programmer...

thank you.


Save this files as index.html then click the menu item use alert function for debug

<!DOCTYPE html>
<html xmlns="">

        <title>Accordion test</title>
        <script type="text/javascript" src="http://ajax.googleapis.centercodehereom/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {

                // initialize accordion
                $('#Accordion ul').each(function () {
                    var currentURI = window.location.href;
                    var links = $('a', this);
                    var collapse = true;
                    for (var i = 0; i < links.size() ; i++) {
                        var elem = links.eq(i);
                        var href = elem.attr('href');
                        var hrefLength = href.length;
                        var compareTo = currentURI.substr(-1 * hrefLength);

                        if (href == compareTo) {
                            collapse = false;
                    if (collapse) {

                // on click, show this element and hide all others
                $('#Accordion > li').click(function () {
                    var me = $(this).children('ul');
                    $('#Accordion ul').not(me).slideUp();
    <ul id="Accordion">
                <li><strong>+</strong> <a href="index.html?show=Yousuf&Ali">Yousuf Ali</a></li>
                <li><strong>+</strong> <a href="index.html?show=hanifa">HANIFA</a></li>            
                <li><strong>+</strong> <a href="index.html?show=Mohamed">MOHAMED</a></li>

                <li><strong>+</strong> <a  href="index.html?show=Khaja&Mohideen">COMING SOON</a></li>
                <li><strong>+</strong> <a  href="index.html?show=Askar&Ali">COMING SOON</a></li>
                <li><strong>+</strong> <a  href="index.html?show=Mohideen&Ali">COMING SOON</a></li>

Need Your Help

Interpolation using armadillo

c++ interpolation armadillo

So it appears as though armadillo does not have any interpolation capability (at least I can find no reference to it in the documentation). I was wondering if anyone has any suggestions on how best...

Objective-c animation block doesn't seem to fire

iphone objective-c xcode animation uiview

I have a method in my UIView subclass "Card" to dismiss an instance by fading its alpha from 1 to 0. I do a similar thing when I add the card to the superview and it fades in fine. But when I call