简体   繁体   中英

Know which list item is clicked on a master page from content page

I have the below unordered list on a master page

<ul class="nav nav-second-level" id ="translist">
    <li>
        <a href="Deposit.aspx">Deposit</a>
    </li>
    <li>
        <a href="Deposit.aspx">Withdrawal</a>
    </li>
</ul>

Both will call the same page but based on which item is selected, I will populate the same page with dynamic data and keep that information in asp.net session variable or something to use later at server side. Please assist

You could use the onclick attribute and specify what to do in javascript

<a href="Deposit.aspx" onclick="function1()">Deposit</a>

<a href="Deposit.aspx" onclick="function2()">Deposit</a>

then implement function1 & function2 in javascript

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM