Users Pricing

forum

Home Forums Set Session variable on menu item's click in asp.net – MindStick

Set Session variable on menu item's click in asp.net

Mark Devid 3729 08 Oct 2014
ASP newbie here, in my website I need to set a session variable when I click the menu item
How can I achieve this, I have a menu control in my master page which has a sitemap file attached to it?

<asp:Menu ID="mainMenu" runat="server" DataSourceID="siteMapSource"
    StaticDisplayLevels="10" Width="150px">
    <StaticSelectedStyle CssClass="menuNodeSelected" />
    <LevelMenuItemStyles>
        <asp:MenuItemStyle Font-Bold="True" Font-Underline="False" />
    </LevelMenuItemStyles>
    <StaticMenuItemStyle CssClass="menuNode" />
</asp:Menu>
<asp:SiteMapDataSource ID="siteMapSource" runat="server" ShowStartingNode="False" />


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md