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?

Tepken Vannkorn
  • 9,648
  • 14
  • 61
  • 86
Sankar M
  • 4,549
  • 12
  • 37
  • 55
  • http://stackoverflow.com/questions/195951/change-an-elements-css-class-with-javascript ....... http://stackoverflow.com/questions/7941276/how-to-change-the-class-of-a-div-when-clicking-on-it ..... http://stackoverflow.com/questions/7014385/javascript-jquery-to-change-class-onclick ... have a look at these links..it may help you – RbG Aug 09 '13 at 08:01
  • I need to handle this in server side! How ? – Sankar M Aug 09 '13 at 08:10
  • ... The above code changing the class name but it agains come to the original class after refresh.. – Sankar M Aug 09 '13 at 08:44
  • Why have you said you need to do it server side and then proceeded to show an example of clientside? – Pete Aug 09 '13 at 08:49
  • Save it into a cookie if somebody clicked and check if the cookie is present on every load... http://www.w3schools.com/js/js_cookies.asp – Maria Aug 09 '13 at 08:54

0 Answers0