08 2011 档案
正则表达式经典
摘要:\d{2,5}-\d{7,8} 普通座机的验证(010/0531-1234567/12345678)/^(13[0-9]|15[0|0|2|3|6|7|8|9]|18[6|8|9])\d{8}$/ 最新手机号验证"^\d+$ " //非负整数(正整数 + 0) "^[0-9]*[1-9][0-9]*$ " //正整数 "^((-\d+)|(0+))$ " //非正整数(负整数 + 0) "^-[0-9]*[1-9][0-9]*$ " //负整数 "^-?\d+$ " //整数 "^\d 阅读全文
posted @ 2011-08-31 23:05 易尔购 阅读(1945) 评论(0) 推荐(0)
Js在vs2005中的断点调试
摘要:在需要调试的地方加上此debugger; 阅读全文
posted @ 2011-08-31 10:33 易尔购 阅读(142) 评论(0) 推荐(0)
GridView.RowCommand 事件
摘要:当单击 GridView控件中的按钮时发生。命名空间:System.Web.UI.WebControls程序集:System.Web(在 system.web.dll 中)在单击 GridView 控件中的按钮时,将引发 RowCommand 事件。这使您可以提供一个这样的事件处理方法,即每次发生此事件时执行一个自定义例程。GridView 控件中的按钮也可调用该控件的某些内置功能。若要执行这些操作之一,请将按钮的 CommandName 属性设置为下表中的某个值。CommandName 值说明“Cancel”取消编辑操作并将 GridView 控件返回为只读模式。引发 RowCancelin 阅读全文
posted @ 2011-08-30 17:12 易尔购 阅读(4683) 评论(0) 推荐(0)
js脚本中过滤特殊字符的正则表达式
摘要:js脚本中过滤特殊字符的正则表达式代码:function stripscript(s) { var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]") var rs = ""; for (var i = 0; i < s.length; i++) { rs = rs+s.substr(i, 1).replace(pattern, ''); } return rs; 阅读全文
posted @ 2011-08-29 10:30 易尔购 阅读(15824) 评论(0) 推荐(0)
我刚做的一个TreeView的CheckBox进行选中插入数据库,从数据库中读取数据后让CheckBox勾选的代码!
摘要:#region 绑定角色 /// <summary> /// 绑定权限信息 /// </summary> protected void BindgvRoles() { string sql = "select * from GM_FileKind"; DataTable dt = OADBHelper.GetDataTable(sql); this.gvRoles.DataSource = dt; this.DataBind(); } #endregion #region TreeView 表员工表的显示至TreeView控件 /// <sum 阅读全文
posted @ 2011-08-27 16:04 易尔购 阅读(4220) 评论(1) 推荐(0)
Iframe问题
摘要:function window.onload() { parent.document.all("FeiYong").style.height=window.screen.availHeight-window.screenTop-document.documentElement.scrollTop; } 阅读全文
posted @ 2011-08-25 17:45 易尔购 阅读(165) 评论(0) 推荐(0)
转:GridView 中如何给删除按钮添加提示
摘要:一.用惯了datagrid,第一次用gridView,倒有点不习惯.写删除确认时还有点不习惯,经过一番折磨,gridView的删除确认可以这样写:if (e.Row.RowType == DataControlRowType.DataRow)...{ e.Row.Cells[0].Attributes.Add ("onclick", "javascript:return confirm('确定删除?')"); }把上面这段放在GridView1_RowDataBound事件里或GridView1_RowCreated里都可以.转:http 阅读全文
posted @ 2011-08-22 18:15 易尔购 阅读(447) 评论(0) 推荐(0)
【转】 sql2000修改数据库名称
摘要:Use master EXEC sp_dboption 'OldDbName', 'Single User', 'TRUE' EXEC sp_renamedb 'OldDbName', 'NewDbName' EXEC sp_dboption 'NewDbName', 'Single User', 'FALSE' GO EXEC sp_dboption 'OldDbName', 'Single User', 'TRUE' 阅读全文
posted @ 2011-08-20 13:13 易尔购 阅读(2715) 评论(0) 推荐(0)
获取上一页面的URL的方法
摘要:string ReUrl = Request.UrlReferrer.ToString(); 阅读全文
posted @ 2011-08-19 11:30 易尔购 阅读(192) 评论(0) 推荐(0)
JS控制TreeView的CheckBox控件的全选与全不选脚本
摘要:function client_OnTreeNodeChecked(){var obj = window.event.srcElement;var treeNodeFound = false;var checkedState;if (obj.tagName == "INPUT" && obj.type == "checkbox") {var treeNode = obj;checkedState = treeNode.checked;do{obj = obj.parentElement;} while (obj.tagName != &q 阅读全文
posted @ 2011-08-15 17:21 易尔购 阅读(1246) 评论(0) 推荐(0)
Repeat控件绑定数据格式显示
摘要:<%# DataBinder.Eval(Container.DataItem,"YingShouEr","{0:C}")%>前台显示格式为:¥5,758.00 阅读全文
posted @ 2011-08-15 14:14 易尔购 阅读(217) 评论(0) 推荐(0)
.net如何从后台获取repeater中的控件值
摘要:repeater OnItemCommand 事件中TextBox txt = (TextBox)e.Item.FindControl("repeater中控件名称");然后执行数据库更新操作,更新数据foreach (RepeaterItem item in Repeater1.Items) { TextBox txtNiName = (TextBox)item.FindControl("txtNiName"); string name=txtNiName.text; } 阅读全文
posted @ 2011-08-15 12:01 易尔购 阅读(3660) 评论(0) 推荐(0)
类库中使用ConfigurationManager.ConnectionStrings的步骤。
摘要:一直没弄明白怎么在类库中找不到 ConfigurationManager.ConnectionStrings 后面才发现没有添加System.configuration的引用,添加后:引入命名空间: 代码如下:using System.Configuration;便可以使用了: 代码如下:public static string ConnectionString = ConfigurationManager.ConnectionStrings["Conn"].ToString();详细出处参考:http://www.jb51.net/article/18872.htm 阅读全文
posted @ 2011-08-15 11:30 易尔购 阅读(3633) 评论(2) 推荐(0)
Decimal转换成¥:123.00格式后再转换成Decimal格式的方法
摘要:<asp:BoundField DataField="QianShouEr" HeaderText="欠收额(元)" DataFormatString="{0:C}" HtmlEncode="false"> <HeaderStyle BorderColor="Black" BorderWidth="1px" HorizontalAlign="Center" VerticalAlign="Middle" Width=&q 阅读全文
posted @ 2011-08-15 10:56 易尔购 阅读(751) 评论(0) 推荐(0)
C# String.Format大全
摘要:字符型转换 转为字符串 12345.ToString("n"); //生成 12,345.00 12345.ToString("C"); //生成 ¥12,345.00 12345.ToString("e"); //生成 1.234500e+004 12345.ToString("f4"); //生成 12345.0000 12345.ToString("x"); //生成 3039 (16进制) 12345.ToString("p"); //生成 1,234,500.00% 阅读全文
posted @ 2011-08-15 10:38 易尔购 阅读(3387) 评论(0) 推荐(1)
ASP.NET的gridview设置数据格式(DataFormatString="{}")与 String.Format 使用总结 .
摘要:{0:d} YY-MM-DD{0:p} 百分比00.00%{0:N2} 12.68{0:N0} 13{0:c2} $12.68{0:d} 3/23/2003{0:T} 12:00:00 AM{0:男;;女} “;”字符用于分隔格式字符串中的正数、负数和零各部分。DataGrid-数据格式设置表达式 这里需要注意以下几点1. 在GridView中的asp:BoundField使用DataFormatString必须设置属性HtmlEncode="False",否则不起作用。2. 如果需要使用日期类型的格式化字符串,必须数据实体中对应的字段也应该日起类型的。3. 格式化字符串C 阅读全文
posted @ 2011-08-15 10:20 易尔购 阅读(6062) 评论(0) 推荐(0)
asp.net页面控制输出decimal显示格式
摘要:<asp:TemplateColumn HeaderText="金额(元)"> <itemstyle horizontalalign="Right" /> <footerstyle horizontalalign="Right" width="8%" /> <footertemplate > <asp:Label id="Alltotal" runat="server" ReadOnly="true" 阅读全文
posted @ 2011-08-15 10:12 易尔购 阅读(5050) 评论(0) 推荐(0)
asp.net更改文件夹名称及新建文件夹及删除文件夹
摘要:if (Directory.Exists(oldPath)) { Directory.Move(oldPath, path); if (OADBHelper.GetInt(sql) > 0) { Response.Write("<script>alert('更新成功!');</script>"); } else { Response.Write("<script>alert('更新失败!');</script>"); } } else { Response.Write( 阅读全文
posted @ 2011-08-14 16:23 易尔购 阅读(2721) 评论(1) 推荐(0)
asp.net如何更改文件名!
摘要:把c:\aa.txt 改名成 c:\bb.txtstring srcFileName=@ "c:\meng\a.txt "; string destFileName=@ "c:\meng\b.txt "; string srcFolderPath=@ "c:\temp "; string destFolderPath=@ "c:\temp11 "; //方法一 if (System.IO.File.Exists(srcFileName)) { System.IO.File.Move(srcFileName,dest 阅读全文
posted @ 2011-08-14 12:11 易尔购 阅读(3893) 评论(0) 推荐(0)
Repeater嵌套绑定Repeater
摘要:Repeater嵌套Repeater的结构:一般写过的都能看懂吧cs代码:CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->privatevoidRpTypeBind(){//GetQuestionTypeAndCount()返回一个datatablethis.rptypelist.DataSource=LiftQuestionCtr.GetQuestionTypeAndCount();this.rptypelist.DataBind( 阅读全文
posted @ 2011-08-13 09:20 易尔购 阅读(205) 评论(0) 推荐(0)