ÓÃ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
Ïà¹ØÎĵµ£º
string cbSelectOnClickJS = @"
if(this.checked)
{
  ......
/*
ÓÉÓÚjavascriptÊÇÒ»ÖÖÎÞÀàÐÍÓïÑÔ,ËùÒÔÒ»¸öÊý×éµÄÔªËØ¿ÉÒÔ¾ßÓÐÈÎÒâµÄÊý¾ÝÀàÐÍ,ͬһ¸öÊý×éµÄ²»Í¬ÔªËØ
¿ÉÒÔ¾ßÓв»Í¬µÄÀàÐÍ,Êý×éµÄÔªËØÉèÖÿÉÒÔ°üº¬ÆäËûÊý×é,ÕâÑù¾Í¿ÉÒÔ´´½¨Ò»¸ö¸´ÔÓµÄÊý×éÁË.
²¢ÇÒÔÚÕâµãÉÏ˵javascript×÷ΪһÖֽű¾ÓïÑÔ²»Í¬ÓÚÄÇÖÖÑϸñµÄÃæÏò¶ÔÏóµÄc++.c#,javaÁË.¾ßÓиü¸ßµÄÁé»îÐÔ.
*/
/*
ÔÚjavascript ......
<!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>
<title>Admin ManageMenu</title>
&n ......
javascript ´úÂëΪ£º
function getName(code){
var name=xzqh[code];
if(name==null){
return name;
}
//Èç¹û²»ÊÇ00½áβµÄ£¬Ôò²¹ÉÏÊÐÃû³Æ£¬659000ÀýÍâ 429000,469000
if(code%100 != 0 && (code-code%100)!=659000 && (code-code%100)!=429000 && (code-code%100)!=469000){
var cityName= ......
¸Õ²ÅÒ»¸öÅóÓѸæËßÎÒËûµÄblogÓÑÇéÁ´½ÓÌ«¶àÁË£¬ËùÒÔ°ÑËùÓÐÁ´½Ó·Åµ½Ò»¸öDIVÖУ¬¼ÓÁ˸ö¹ö¶¯Ìõ£¬¿ÉÊÇËûÓÖ²»Ïëÿ´Î±ðÈËÀ´¿´£¬¿´µ½µÄ¶¼ÊÇÇ°Ã漸¸öÁ´½Ó£¬ÓÚÊÇÎÊÎÒÓÐûÓÐʲô°ì·¨£¬ÏëÁËÒ»¸ö£¬ºÇºÇ£¬ÕýºÃÓиö°ì·¨
styleºóÃæÓÃÓÚÏÞ¶¨DIVÑùʽ²¢¼Ó¹ö¶¯Ìõ£¬Õâ¸ö²»¶à˵
¹Ø¼üµÄµØ·½ÆäʵºÜ¼òµ¥£¬×îºóÁ½ÐÐJavascript¾ÍÊÇÁË£¬Æð×÷ÓõÄÖ»ÓÐ×îº ......