找回密码
 立即注册

QQ登录

只需一步,快速开始

wahaha

社区贡献组

44

主题

101

帖子

2723

积分

社区贡献组

积分
2723

活字格认证

[已处理] C1Menu Support

wahaha
社区贡献组   /  发表于:2013-2-26 09:12  /   查看:4632  /  回复:1
I am using C1Menu with ASP.NET (VS2012). When user click one of C1MenuItem, and a JavaScript function invoked to handle it (OnClientSelect). How can I get the selected menuitem? I know that I can use _getText to get the menuitem Text.

代发帖

1 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2013-2-26 11:52:00
沙发
回复 1楼wahaha的帖子

请使用以下代码从前台获取点击对象:
CS:

  1. protected void Page_Load(object sender, EventArgs e)
  2.         {
  3.             if (IsPostBack)
  4.             {
  5.                 return;
  6.             }
  7.             this.C1Menu1.OnClientSelect = "test";
  8.         }
复制代码

JS:

  1.     <script type="text/javascript">
  2.         function test(e,data) {
  3.             alert(data.item.options.text);
  4.         }
  5.     </script>
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部