悟生慧

 

2010年7月14日

回车转换成Tab

摘要: <script language="javascript" for="document" event="onkeydown"> if(event.keyCode==13 && event.srcElement.type!=’button’ && event.srcElement.type!=’submit’... 阅读全文

posted @ 2010-07-14 16:40 悟生慧 阅读(205) 评论(0) 推荐(0)

获取错误信息并到指定页面

摘要: 不要使用Response.Redirect,而应该使用Server.Transfer例子:// in global.asax protected void Application_Error(Object sender, EventArgs e) { if (Server.GetLastError() is HttpUnhandledException) Server.Transfer("MyEr... 阅读全文

posted @ 2010-07-14 16:38 悟生慧 阅读(153) 评论(0) 推荐(0)

连接字符串 config

摘要: ConfigurationManager.ConnectionStrings["connstring"].ConnectionString<connectionStrings> <add name="connstring" connectionString="server=.;uid=sa;pwd=111111;database=database" providerName="S... 阅读全文

posted @ 2010-07-14 16:35 悟生慧 阅读(170) 评论(0) 推荐(0)

为按钮添加对话框

摘要: Button1.Attributes.Add("onclick","return confirm(’确认?’)"); button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}") 阅读全文

posted @ 2010-07-14 14:51 悟生慧 阅读(190) 评论(0) 推荐(0)

打开新的窗口并传送参数

摘要: response.write("<script>window.open(' *.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>") 阅读全文

posted @ 2010-07-14 14:50 悟生慧 阅读(222) 评论(0) 推荐(0)

2010年7月8日

读取xml中的所有文件名

摘要: void FindFile(Directory d){ FileOrFolders = d.GetFileOrFolders(); foreach(FileOrFolders fof in FileOrFolders) { if(for is File) { you founda File; } else if(for is Directory) { FildFile(fof); } }} 阅读全文

posted @ 2010-07-08 11:39 悟生慧 阅读(292) 评论(0) 推荐(0)

2010年7月5日

在后台引入外部CSS文件

摘要: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { HtmlLink link = new HtmlLink(); link.Attributes.Add("type", "text/css"); link.Attributes.Add("rel", "stylesheet"); l... 阅读全文

posted @ 2010-07-05 13:31 悟生慧 阅读(365) 评论(0) 推荐(0)

2010年7月2日

js判断是否为数字

摘要: function IsNum(num){ var reNum=/^\d*$/; return(reNum.test(num));}var str=document.getElementById("name").value; var reg = /^[\u4e00-\u9fa5]+$/i; //判断是否为汉字if (!reg.test(str)) { alert("请输入中文名字!"); docum... 阅读全文

posted @ 2010-07-02 17:22 悟生慧 阅读(1151) 评论(0) 推荐(0)

SqlServerDBHelper类

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.SqlClient;namespace DAL{ /// <summary> /// 连接数据库类 /// </summary> publi... 阅读全文

posted @ 2010-07-02 16:18 悟生慧 阅读(2149) 评论(0) 推荐(0)

Ajax验证输入值是否已存在完整版

摘要: var http_request=false; function createRequest()//Ajax验证 { try//IE { http_request=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } c... 阅读全文

posted @ 2010-07-02 16:15 悟生慧 阅读(861) 评论(0) 推荐(0)

导航