sisibest

导航

2013年1月7日

For 循环 和Foreach 的区别

摘要: 在固定长度或长度不需要计算的时候for循环效率高于foreach.在不确定长度,或计算长度有性能损耗的时候,用foreach比较方便.并且foreach的时候会锁定集合中的对象.期间不能修改. 阅读全文

posted @ 2013-01-07 15:46 sisibest 阅读(229) 评论(0) 推荐(0) 编辑

2013年1月6日

window.showModalDialog刷新父窗口和本窗口的方法及注意

摘要: 在点击window.showModalDialog窗口的链接的时候会打开新窗口,想要阻止打开新窗口,需要在窗口页面中的html和body之间 加入: <base target="_self" />即可 阅读全文

posted @ 2013-01-06 15:47 sisibest 阅读(118) 评论(0) 推荐(0) 编辑

输入正确的邮箱地址

摘要: <td> <asp:TextBox ID="txtEmail" runat="server" Width="160px"></asp:TextBox> <asp:RegularExpressionValidator ID="revEmail" runat="server" ErrorMessage="请输入正确的邮箱地址!" Display="None" ValidationGroup="1" 阅读全文

posted @ 2013-01-06 14:07 sisibest 阅读(529) 评论(0) 推荐(0) 编辑

密码 必须大于六位

摘要: function Validator_CheckPassword(source, args) { var result = true; var password = $("#<%=txtPassword.ClientID %>").val(); if ($.trim(password) != '') { if ($.trim(password).length < 6) { result = false; } } args.IsValid = result; }<td> <asp:TextBox ID="txtPa 阅读全文

posted @ 2013-01-06 14:02 sisibest 阅读(490) 评论(0) 推荐(0) 编辑

SQL 拿到一天内的数据

摘要: CreateDate>=startDate&& CreateDate<=endDateif (!string.IsNullOrEmpty(startDate)) { sbWhere.Append(" and DATEDIFF(day,CreateDate,'"+startDate+"')<=0"); } if (!string.IsNullOrEmpty(endDate)) { sbWhere.Append(" and DATEDIFF(day,CreateDate,'"+en 阅读全文

posted @ 2013-01-06 11:39 sisibest 阅读(213) 评论(0) 推荐(0) 编辑

2012年12月19日

jquery中的$(document).ready()方法和window.onload方法区别

摘要: 大多数情况下,jquery代码的编写,都要求我们将jquery的代码放在?123$(document).ready(function(){ ........jquery代码........... });上面的代码和?123$().ready(function(){ ........jquery代码........... });?123$(function(){ ........jquery代码........... });是等同的~~最后一种方式是最简洁的方式,绝大多数情况下我都使用最后一种写法,呵呵~~好记!注意:有时候我们自己编写的jquery代码出现莫名其妙的问题,看似正常的代码,但是就 阅读全文

posted @ 2012-12-19 17:20 sisibest 阅读(157) 评论(0) 推荐(0) 编辑

在线脚本编辑器

摘要: http://www.skygq.com/ci/diy/index/108.html 阅读全文

posted @ 2012-12-19 17:16 sisibest 阅读(159) 评论(0) 推荐(0) 编辑

2012年12月17日

GridView中DropDownList联动

摘要: GridView中DropDownList联动2010-07-30 00:26 by Jun2009, 228 阅读, 0 评论, 收藏, 编辑1.在GridView模板列中添加DropDownList并设置AutoPostback属性为true。2.再在DropDownList的SelectedIndexChanged事件里写下面几句话。DropDownList ddl = (DropDownList)sender;//得到当前的DropDownListGridViewRow gvr = (GridViewRow)ddl.NamingContainer;//获取对DropDownList的容 阅读全文

posted @ 2012-12-17 15:54 sisibest 阅读(129) 评论(0) 推荐(0) 编辑

转载--从XML文件中读取数据绑定到DropDownList

摘要: 1、绑定DropDownList: ddl_language.DataSource = createDataSource();ddl_language.DataTextField = "languageTextField";ddl_language.DataValueField = "languageValueField";ddl_language.DataBind();2、上面用到的createDataSource()方法: private ICollection createDataSource() { //create a data table t 阅读全文

posted @ 2012-12-17 15:50 sisibest 阅读(153) 评论(0) 推荐(0) 编辑

c#.net语句e.Row.RowType == DataControlRowType.DataRow是什么含义?

摘要: c#.net语句e.Row.RowType == DataControlRowType.DataRow是什么含义?事件语句 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[3].Text = Convert.ToDateTime(e.Row.Cells[3].Text).ToShortDateString(); } } 中 e.Row.RowType 是什么意思 阅读全文

posted @ 2012-12-17 11:02 sisibest 阅读(1386) 评论(0) 推荐(0) 编辑