如何从gridview或数据列表中调用客户端功能 [英] how to call a client side function from gridview or datalist

查看:95
本文介绍了如何从gridview或数据列表中调用客户端功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从数据集绑定的网格视图.

我已经采用了这样的span标签

I have a grid view which is binding from a dataset.

I have taken a span tag like this

<span>demo text</span>



当当时绑定gridview或datalist时,我想调用客户端功能,并根据跨度值更改其颜色,我想更改

我的客户端功能是这样的



when gridview or datalist bound at that time i want to call client side function, and based on span value it''s color i want to change

my client side function like this

fucntion spancolorchange(spanid){

// here color change code
.....
....

}

推荐答案

是.通过从为gridview生成的HTML标签中读取值,可以从javascript动态地为它们分配颜色.


http://www.mindfiresolutions.com/How-to-set-alternative-row-color-of-grid-using-jQuery-193.php [
Yes. By reading the value from the HTML tags generated for the gridview, you can assign them colors , dynamically, from the javascript.


http://www.mindfiresolutions.com/How-to-set-alternative-row-color-of-grid-using-jQuery-193.php[^]


use
use
document.getElementById('<%=yourGridID.ClientID%>').style.backgroundColor=document.getElementById('yourspanID').innerHTML;


这篇关于如何从gridview或数据列表中调用客户端功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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