0

Below is my code:

<asp:ListView ID="lViewMenu" runat="server">
    <ItemTemplate>
        <li class="context-menu-group"><span class="color-bar color-13"></span>
            <asp:LinkButton ID="lbtnMenu" runat="server" Text='<%# Eval("MenuName")%>' OnClick="lbtnMenu_Click"></asp:LinkButton>
        </li>
    </ItemTemplate>
</asp:ListView>

And i need to change the class name of <li> to context-menu-group active when a LinkButton is clicked on the onclick() How?

5
  • stackoverflow.com/questions/195951/… ....... stackoverflow.com/questions/7941276/… ..... stackoverflow.com/questions/7014385/… ... have a look at these links..it may help you Commented Aug 9, 2013 at 8:01
  • I need to handle this in server side! How ? Commented Aug 9, 2013 at 8:10
  • <li class="context-menu-group" onclick="this.className='context-menu-group active'"> ... The above code changing the class name but it agains come to the original class after refresh.. Commented Aug 9, 2013 at 8:44
  • Why have you said you need to do it server side and then proceeded to show an example of clientside? Commented Aug 9, 2013 at 8:49
  • Save it into a cookie if somebody clicked and check if the cookie is present on every load... w3schools.com/js/js_cookies.asp Commented Aug 9, 2013 at 8:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.