Aim: To add a session to the ASP button so I can change the CSS value based on a set of rules.
Code so far:
<asp:Button ID="btnMyDetails" runat="server" Text="My Details" CssClass="<%=Session.Item('btnMyDetails').ToString()%>" CausesValidation="False" />
Error:
The above code tries to run the session as text and not a session. I've tried with both " and ' around.
History:
I have a working version where I use lists but would like to remove this extra coding:
<li class="<%=Session.Item("btnMyDetails").ToString()%>"
<asp:Button ID="btnMyDetails" runat="server" Text="All" CssClass="Button" /></li>