上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 16 下一页

2012年9月27日

鼠标停留在GridView某一行时,行的颜色改变

摘要: 鼠标停留在GridView某一行时,行的颜色改变protected void gvdegreetype_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='GhostWhite'"); e.Row.Attributes.Add("onmouseo 阅读全文

posted @ 2012-09-27 16:18 baixp2008 阅读(204) 评论(0) 推荐(0) 编辑

Asp.netGridview实现CheckBox全选

摘要: Asp.netGridview实现CheckBox全选在GridView中我们经常要利用复选按钮实现全选的功能,下面针对这一解决方案做以总结第一种:利用客户端控件实现 JS: 复制代码 代码如下:<script type="text/javascript"> function checkAll() { var checklist=document.getElementsByTagName("input"); //传入当前对象即GridViewfor(var i=0;i<checklist.length;i++) { if(checkli 阅读全文

posted @ 2012-09-27 16:18 baixp2008 阅读(168) 评论(0) 推荐(0) 编辑

鼠标移到GridView某一行时改变该行的背景色方法

摘要: 鼠标移到GridView某一行时改变该行的背景色方法6.鼠标移到GridView某一行时改变该行的背景色方法一:效果图:做法:双击GridView的OnRowDataBound事件;在后台的GridView1_RowDataBound()方法添加代码,最后代码如下所示:protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { int i; //执行循环,保证每条数据都可以更新 for (i = 0; i < GridView1.Rows.Count; i++) { //首先判断是否是数据行 阅读全文

posted @ 2012-09-27 16:17 baixp2008 阅读(261) 评论(0) 推荐(0) 编辑

GridView自定义分页的四种存储过程

摘要: GridView自定义分页的四种存储过程1. 为什么不使用GridView的默认分页功能首先要说说为什么不用GridView的默认的分页功能,GridView控件并非真正知道如何获得一个新页面,它只是请求绑定的数据源控件返回适合规定页面的行,分页最终是由数据源控件完成。当我们使用SqlDataSource或使用以上的代码处理分页时。每次这个页面被请求或者回发时,所有和这个SELECT语句匹配的记录都被读取并存储到一个内部的DataSet中,但只显示适合当前页面大小的记录数。也就是说有可能使用Select语句返回1000000条记录,而每次回发只显示10条记录。如果启用了SqlDataSourc 阅读全文

posted @ 2012-09-27 16:16 baixp2008 阅读(148) 评论(0) 推荐(0) 编辑

ASP.NET GridView自定义分页的方法

摘要: ASP.NET GridView自定义分页的方法<asp:GridView ID="GridView2" runat="server" AllowPaging="True"> <PagerTemplate> <div id="main"> <table> <tr> <td style="text-align:left;"> <div id="info">&nbsp;&nbsp; 阅读全文

posted @ 2012-09-27 16:15 baixp2008 阅读(198) 评论(0) 推荐(0) 编辑

GridView自定义编辑、删除、全选删除代码

摘要: GridView自定义编辑、删除、全选删除代码using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class _Def 阅读全文

posted @ 2012-09-27 16:14 baixp2008 阅读(169) 评论(0) 推荐(0) 编辑

实现对gridview删除行时弹出确认对话框的四种方法

摘要: 实现对gridview删除行时弹出确认对话框的四种方法在.net2.0中,实现对gridview删除行时弹出确认对话框的四种方法 1,GridView中如何使用CommandField删除时,弹出确认框? 在VS2005提供的GridView中我们可以直接添加一个CommandField删除列:<asp:CommandField ShowDeleteButton="True" />,完后在它的RowDeleting事件中完成删除。但在多半我们在做这种删除操作时都需要先让操作者再确认下,完后再进行删除,以避免误操作引起的误删除。可以通过下面方法给GridView删 阅读全文

posted @ 2012-09-27 16:13 baixp2008 阅读(299) 评论(0) 推荐(0) 编辑

ASP.NET 2.0,C#----利用GridView控件导出其他文件(导出Excel,导出Word文件)

摘要: ASP.NET 2.0,C#----利用GridView控件导出其他文件(导出Excel,导出Word文件)// 注意,在Visual Studio2005平台下,如果使用GridView导出文件,//就必须重载VerifyRenderingInServerForm方法public override void VerifyRenderingInServerForm(Control control){}/// <summary>///导出到文件的方法,/// </summary>/// <param name="Model">Model=1 阅读全文

posted @ 2012-09-27 16:08 baixp2008 阅读(202) 评论(0) 推荐(0) 编辑

asp.net三种事务处理

摘要: asp.net三种事务处理三种事务处理事务处理是在数据处理时经常遇到的问题,经常用到的方法有以下3种总结整理如下:方法1:直接写入到sql 中在存储过程中使用 BEGIN TRANS, COMMIT TRANS, ROLLBACK TRANS 实现begin transdeclare @orderDetailsError int,@procuntError intdelete from [order details] where productid=42select @orderDetailsError =@@errordelete from products where productid= 阅读全文

posted @ 2012-09-27 16:07 baixp2008 阅读(149) 评论(0) 推荐(0) 编辑

asp.net使用事务

摘要: asp.net使用事务1、SqlServer存储过程 的事务处理方法一:--测试的表 create table tb( id int not null constraint PK_sys_zj_fielddict primary key ,aa int) --事务处理 begin tran insert into tb values(1,1) if @@error<>0 goto lb_rollback insert into tb values(1,1) if @@error<>0 goto lb_rollback ins... 阅读全文

posted @ 2012-09-27 15:57 baixp2008 阅读(166) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 16 下一页

导航