GridView - OnClientClick [英] GridView - OnClientClick

查看:94
本文介绍了GridView - OnClientClick的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户单击GridView中的单元格时,如何激活脚本。当用户单击命令按钮(OnClientClick)时,可以激活与脚本相同的方式。简而言之,我可以通过GridView.RowCommand事件中的代码激活脚本吗?

谢谢,
Lennart Hoglund

How can I activate a script when the User click on a cell in a GridView. The same way as a script can be activated when the User click a command button (OnClientClick). In short, can I activate a script thru code in a GridView.RowCommand event?

Thanks,
Lennart Hoglund

推荐答案

我没有在ASP .NET中做任何事情,但我认为这个解决方案可以工作。
在JScript .NET中触发事件有一种令人不舒服的方法。你必须编写自己的类来扩展GridView并覆盖On ....()方法:

I haven't made anything in ASP .NET but I think this solution could work.
There is an uncomfortable way to fire events in JScript .NET. You must write your own class extending GridView and override the On....() method:


class MyGridView extends GridView {

    protected override function OnRowCommand(e : GridViewCommandEventArgs) {

        // your code for execution

    }

}


这篇关于GridView - OnClientClick的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆