原文发布时间为:2009-04-21 —— 来源于本人的百度文章 [由搬家工具导入]

点击行,链接!!
可这样,在GridView的RowDataBound输入代码,假如id在第0列,且不是摸板列:

C# code
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e){ if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("style", "cursor: hand;");//将光标设为手形 e.Row.Attributes.Add("onclick", "ItemOver(this," + e.Row.Cells[0].Text + ")"); }}

js代码:

JScript code
<script language="javascript" type="text/javascript"> if (!objbeforeItem) { var objbeforeItem=null; var objbeforeItembackgroundColor=null; } function ItemOver(obj,id) { if(objbeforeItem) { objbeforeItem.style.backgroundColor = objbeforeItembackgroundColor; } objbeforeItembackgroundColor = obj.style.backgroundColor; objbeforeItem = obj; obj.style.backgroundColor = "#FFFF00"; window.open("default1.aspx?id="+id); }</script>

gridview行链接的更多相关文章

  1. GridView行中按钮的使用

    转载自:http://blog.csdn.net/hongdi/article/details/6455947 GridView行中按钮的使用 在web项目的过程中,特别是开发ASP.NET应用程序, ...

  2. Oracle 行迁移和行链接

    一.行迁移 1.1.行迁移概念 当一个行上的更新操作(原来的数据存在且没有减少)导致当前的数据不能在容纳在当前块,我们需要进行行迁移.一个行迁移意味着整行数据将会移动,仅仅保留的是一个转移地址.因此整 ...

  3. Asp.Net 之 获取GridView行的DataKeys

    1.后台任意一个位置获取GridView行的主键值 foreach (GridViewRow row in GridView1.Rows) { string order_Id=this.GridVie ...

  4. 模拟Oracle行迁移和行链接

    行链接消除方法创建大的block块------------------ 参考tom kyte的例子----------------------------------------------创建4k ...

  5. [20180730]exadata与行链接.txt

    [20180730]exadata与行链接.txt --//最近一段时间在看<expert oracle exadata>,智能扫描的三大优化方法是:字段投影,谓词过滤,存储索引.大多数智 ...

  6. 利用JavaScript选择GridView行

    本篇技巧和诀窍记录的是:利用JavaScript选择GridView行. 当我们想在GridView中添加删除.选择功能时,我们通常的做法是利用模板功能在每行添加一个按钮控件或者超链接按钮控件,单击按 ...

  7. Yii2 GridView自定义链接之重写 ActionColumn

    最近刚开始用yii2,真是超棒的,但是也有许多不足的地方,今天要说的就是GridView链接问题.   <?= GridView::widget([ 'dataProvider' => $ ...

  8. Dev GridView行拖拽

    http://blog.csdn.net/keyrainie/article/details/8513802 http://www.cnblogs.com/qq4004229/archive/2012 ...

  9. Gridview 行变色和行按钮调用前端js

    1.鼠标移动某一行 ,变色 protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Ro ...

随机推荐

  1. gravity 使用操作。

    gravity 使用操作.最近我司有一个比较奇葩的需求,我们的环境是主从,因为数据量较大会定期的删除数据,最近不行了,要求新建出来一个库 同步正事环境的数据,但是要剔除 delete ,drop,tr ...

  2. gitLab 服务器搭建 (自己服务器上搭建gitLab)

    环境 lunix(ubuntu) 1:添加文件 在   /etc/apt/sources.list.d/gitlab-ce.list 中添加一行 deb https://mirrors.tuna.ts ...

  3. HashMap 排序

    本文章,摘抄自:2018黑马程序最新面试题汇总 已知一个 HashMap<Integer,User>集合, User 有 name(String)和 age(int)属性.请写一个方法实现 ...

  4. php+croppic.js实现剪切上传图片

    最近需要实现裁剪图片上传,想起之前公司用到的一个插件,却不知道叫什么名字了. 在网上找了有些时间,最终找到了这个网站. http://www.croppic.net/ 因为官网文档全部都是英文,所以看 ...

  5. JZOJ 4738. 神在夏至祭降下了神谕 DP + 线段树优化

    4738. 神在夏至祭降下了神谕 Time Limits: 1000 ms  Memory Limits: 262144 KB  Detailed Limits   Goto ProblemSet D ...

  6. Python学习笔记(七)加密加盐

    MD5加密和加盐 Python的MD5加密 Python的hashlib模块的MD5加密,是比较简单一种加密,md5函数必须传入编译后的结果,否则会报错: Traceback (most recent ...

  7. Xadmin添加用户小组件出错render() got an unexpected keyword argument 'renderer

    环境: Python 3.5.6 Django 2.1 Xadmin 原因: render函数在django2.1上有变化 解决方案: 1.在Python终端输入命令help('xadmin') 查看 ...

  8. #3 working with data stored in files && securing your application (PART II)

    Security problems is more and more important on the internet today. You can see the problems . This ...

  9. Apache Common-IO 使用

    Apache Common-IO 是什么? Apache File 工具类,能够方便的操作 File 运行环境 jdk 1.7 commons-io 2.6 测试代码 package com.m.ba ...

  10. N宫格

    <!doctype html> <html> <head> <meta charset="utf-8"> <meta name ...