Chinaunix首页 | 论坛 | 博客
  • 博客访问: 268804
  • 博文数量: 42
  • 博客积分: 2785
  • 博客等级: 少校
  • 技术积分: 893
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-15 12:21
个人简介

一句话介绍

文章分类

全部博文(42)

文章存档

2013年(1)

2012年(1)

2011年(11)

2010年(10)

2009年(6)

2008年(13)

分类:

2008-03-05 17:29:12

//写在Aspx前台中的代码

<script type="text/javascript">
        var last = null;//最后访问的RadioButton的ID

        function judge(obj)
        {
            if(last == null)
            {
                last = obj.id;
           // alert(last);

            }
            else
            {
                var lo = document.getElementById(last);
                lo.checked = "";
         // alert(last + " " + lo.checked);

                last = obj.name;
            }
            obj.checked = "checked";
        }
    </script>


'后台的代码(VB.Net)

Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound

        If e.Row.RowType = DataControlRowType.DataRow Then

            Dim rb As RadioButton = CType(e.Row.FindControl("rdo"), RadioButton)
            rb.Attributes.Add("onclick", "judge(this)")
        End If
    End Sub

阅读(1681) | 评论(1) | 转发(0) |
0

上一篇:没有了

下一篇:oracle11g行列转换

给主人留下些什么吧!~~

chinaunix网友2008-04-08 01:43:54

fdsfd