ASP.NET GridView的使用详解
这是要实现的功能:
第一步:拖入GridView控件 并且完成查询所有数据的方法 通过this.GridView1.DataSource 获取集合数据 GridView1.DataBind() 绑定数据
第二步:实现全选功能
1. 页面代码:
代码
<asp:TemplateField HeaderText="全选">
<HeaderTemplate>
<input type="checkbox" id="CheckBox1" name="CheckBox1" onclick="GetAllCheckBox(this)" />
全选
</HeaderTemplate>
<ItemTemplate>
<input type="checkbox" name="CheckBox2" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="100px" />
</asp:TemplateField>
2. 实现全选的JS代码:
代码
<script type="text/javascript" language="javascript">
function GetAllCheckBox(checkAll){
var items = document.getElementsByName("CheckBox2");
for(var i=0;i<items.length;i++){
&
相关文档:
asp.net(C#)字符串加密
2010-03-12 09:59
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;//Cryptography密码术
namespace DAL
{
......
在Web开发程序中,往往由于种种原因,客户会多次操作页面导致数据冗余或不一致, 在ASP.NET AJAX出现之前可以通过对__dopostback()的调用等方法也可以防止页面多次提交。
在ASP.NET AJAX中的页面客户端中有一个叫onInitializeRequest的事件,它在页面初始化之前触发,可以对页面的提交事件进行控制,并且可以调用该事件参 ......
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Text;
names ......
刚刚 看到这么一个问题,这里也做个标记:http://topic.csdn.net/u/20080411/14/7b0f9da5-0413-4149-91e9-72c3df3018a3.html?seed=327251592
第一种方式:
//在Visual Studio 2008中调试通过
testPop_Page.aspx:主页面ASPX代码
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  ......
1. 适当使用UpdatePanel
2. 利用WebService方法动态生成用户控件的内容,避免UpdatePanel回传造成的性能损失(ViewState)
3. ToolkitScriptManager代替ScriptManager
4. <asp:ScriptManager runat="server" ID="sm" ScriptMode="Release" EnablePartialRendering="false"
......