2005年12月2日
摘要: 41.判断是否为数字 /**//// /// 名称:IsNumberic /// 功能:判断输入的是否是数字 /// 参数:string oText:源文本 /// 返回值: bool true:是 false:否 /// public bool IsNumberic(string oText) { try { int var1=Convert.ToInt3... 阅读全文
posted @ 2005-12-02 15:06 唐朝 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 31. 当文件在不同目录下,需要获取数据库连接字符串(如果连接字符串放在Web.config,然后在Global.asax中初始化)在Application_Start中添加以下代码: Application["ConnStr"]=this.Context.Request.PhysicalApplicationPath+ConfigurationSettings. AppSettings["... 阅读全文
posted @ 2005-12-02 15:05 唐朝 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 21.如何设定全局变量 Global.asax中 Application_Start()事件中 添加Application[属性名] = xxx; 就是你的全局变量22.怎样作到HyperLinkColumn生成的连接后,点击连接,打开新窗口? HyperLinkColumn有个属性Target,将器值设置成"_blank"即可.(Target="_blank") 【ASPNETMENU... 阅读全文
posted @ 2005-12-02 15:04 唐朝 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 11.自定义异常处理 //自定义异常处理类 using System;using System.Diagnostics;namespace MyAppException{ /**//// <summary> /// 从系统异常类ApplicationException继承的应用程序异常处理类。 /// 自动将异常内容记录到Windows NT/2000的应用程序日志 /// </summary> ... 阅读全文
posted @ 2005-12-02 15:03 唐朝 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1. 打开新的窗口并传送参数: //传送参数:response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="++"’)</script>") //接收参数:string a = Request.QueryString("id");string b = Request.QueryStr... 阅读全文
posted @ 2005-12-02 15:02 唐朝 阅读(173) 评论(0) 推荐(0) 编辑