如何使用jQuery访问asp.net griedview [英] How to access asp.net griedview using jquery

查看:136
本文介绍了如何使用jQuery访问asp.net griedview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个名为GriedView1的gridview,我想使用jquery更改行的背景颜色.我使用一些母版页,并尝试使用以下代码.

$(''table [#id = GridView1] tr'').css({"background-color":#bbb"});

上面的代码不起作用.能帮我解决这个问题吗?

谢谢.


I have a gridview called GriedView1 and I want to change the background color of a row using jquery.I''m using some master page and I tried using following code.

$(''table[#id=GridView1] tr'').css({"background-color":"#bbb"});

above code does not work.Can you please help me to solve this problem!

Thank you.

推荐答案

(''table [#id = GridView1] tr'').css({"background-color":#bbb"}) ;

上面的代码不起作用.能帮我解决这个问题吗?

谢谢.
(''table[#id=GridView1] tr'').css({"background-color":"#bbb"});

above code does not work.Can you please help me to solve this problem!

Thank you.


Gridview只是客户端中的一个表.

只需在浏览器中检查客户端html. Javascript可在客户端使用,因此您需要在客户端执行此操作.

就像您所做的那样,我认为您唯一需要关注的是通过GridView呈现的表的实际ID.

只需转到ViewSource并查看Table的ID.

:rose:
A Gridview is just a table in the client side.

Just inspect the client side html when in the browser. Javascript works in the client side, so you need to do this in the client side.

Just as you did, I think the only thing that you need focus is the actual id of the table that is rendered through the GridView.

Just go to View- Source and see what is the id of the Table.

:rose:


写道:​​

GriedView1

GriedView1



必须问为什么要这样称呼.




One has to ask why it''s called that.


写道:​​


这篇关于如何使用jQuery访问asp.net griedview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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