用javascript操纵GridView中CheckBox的两个常用技巧
using System;
using System.Data;
public partial class CheckBox:System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//生成DataTable并添加相应的列
DataTable dt = new DataTable();
dt.Columns.Add("ID");
dt.Columns.Add("Author");
dt.Columns.Add("Title");
dt.Columns.Add("PostTime");
dt.Columns.Add("URL");
dt.Rows.Add(1, "fisea", "sdfef", "2009-05-11 09:59",
"http://writeblog.csdn.net/PostEdit.aspx");
dt.Rows.Add(2, "fisea", "sdfef", "2009-05-11 09:59",
"http://writeblog.csdn.net/PostEdit.aspx");
dt.Rows.Add(3, "fisea", "sdfef", "2009-05-11 09:59",
"http://writeblog.csdn.net/PostEdit.aspx");
dt.Rows.Add(4, "fisea", "sdfef", "2009-05-11 09:59",
"http://writeblog.csdn.net/PostEdit.aspx");
gvMeiMingZi.DataSource = dt;
gvMeiMingZi.DataBind();
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CheckBox.aspx.cs" Inherits="CheckBox" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>CheckBox</title>
</head>
<body>
<form id="form1" runat="server">
<asp:GridView runat="server" ID="gvMeiMingZi" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<input name="chk" type="checkbox" value="<%#Eval("ID")%>" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ID" HeaderText="ID" />
<asp:BoundField DataField="Author" HeaderText="Author" />
<asp:BoundField DataField="Title" HeaderText="Title
相关文档:
JavaScript 获取客户端计算机硬件及系统信息
通过WMI来实现获取客户端计算机硬件及系统信息:
1//系统信息获取
2function getSysInfo(){
3 var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
4 var service = locator.ConnectServer(".");
5 //CPU信息
6 var cpu = new Enu ......
来源:http://blog.csdn.net/Mr_Von/archive/2009/04/29/4136273.aspx
window.showModalDialog会有缓存,导致第二次不进入pageload,解决方法:跟一个随机的参数:
var time =new Date();
var iW ......
原文网址:http://www.ccvita.com/?s=onbeforepaste
javascript事件列表解说javascript事件列表解说
事件 浏览器支持 解说
一般事件 onclick IE3、N2 鼠标点击时触发此事件
ondblclick IE4、N4 鼠标双击时触发此事件
onmousedown IE4、N4 按下鼠标时触发此事件
onmouseup IE4、N4 鼠标按下后松开鼠标时触发此事 ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0041)/ -->
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>JavaScript仿Excel表格演示- /</TITLE>
< ......