如何从aspx页面传递gridview id到javascript函数? [英] how to pass gridview id to javascript function from aspx page?

查看:45
本文介绍了如何从aspx页面传递gridview id到javascript函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这些代码中有以下javascript代码我想将gridview id作为arugument传递给我如何通过。



onclick =javascript:SelectheaderCheckboxes(this)

解决方案
如果的onclick 在样本属于GridView的,比将是GridView,因此您可以使用 this.id 。其他选项是来自服务器的使用价值:

 onclick =  的javascript:SelectheaderCheckboxes(小于%GridView.ClientId%GT) 

这会更加的onclick 不属于的GridView ...


I have below javascript code in these code i want to pass gridview id as arugument so how can i pass.

onclick="javascript:SelectheaderCheckboxes(this)"

解决方案

If onclick in your sample belongs the GridView, than this will be the GridView, so you can use this.id. Other option is use value from the server:

onclick="javascript:SelectheaderCheckboxes(<% GridView.ClientId %>)"

This will work even onclick not belongs to GridView...


这篇关于如何从aspx页面传递gridview id到javascript函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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