开发者

how to set session variable during click in context menu asp.net

开发者 https://www.devze.com 2023-04-01 00:20 出处:网络
I have question how can I set session variable during click element in content menu. I hav开发者_StackOverflow社区e code like this:

I have question how can I set session variable during click element in content menu. I hav开发者_StackOverflow社区e code like this:

<dl  id='K15m'>
     <dt><asp:imagebutton id="K15"  runat="server" ImageUrl="images\pict.gif"></asp:imagebutton></dt>
  <dd><a  href='page1.aspx'>page1</a></dd>
  <dd><a  href='page2.aspx'>page2</a></dd>
  <dd><a  href='page3.aspx'>page3</a></dd>
 </dl>
  <script type='text/javascript'>
      new Menu('K15m', 'position: absolute;', true, false);
  </script>

<dl  id='K20m'>
     <dt><asp:imagebutton id="K20"  runat="server" ImageUrl="images\pict.gif"></asp:imagebutton></dt>
  <dd><a  href='page1.aspx'>page1</a></dd>
  <dd><a  href='page2.aspx'>page2</a></dd>
  <dd><a  href='page3.aspx'>page3</a></dd>
 </dl>
  <script type='text/javascript'>
      new Menu('K20m', 'position: absolute;', true, false);
  </script>

It works like this. When I move mouse over image pict.gif JS script shows elements from DL list. I would like to set session variable (session("myvar")) to 5 when I click on element from K20m list's and set variable to 10 when I click on element from K15m list's All code is written in VS2010. please help .


You have to make an ajax call to a server method to set this variables ausing JQuery Ajax or Srcipt Manager and page methods.

0

精彩评论

暂无评论...
验证码 换一张
取 消