文章分类 -  asp.net与c#

常用代码5[转]
摘要:41.判断是否为数字 /**//// /// 名称:IsNumberic /// 功能:判断输入的是否是数字 /// 参数:string oText:源文本 /// 返回值: bool true:是 false:否 /// public bool IsNumberic(string oText) { try { int var1=Convert.ToInt3... 阅读全文
posted @ 2006-02-20 16:00 .net技術 阅读(170) 评论(0) 推荐(0)
常用代码 4
摘要:31. 当文件在不同目录下,需要获取数据库连接字符串(如果连接字符串放在Web.config,然后在Global.asax中初始化)在Application_Start中添加以下代码: Application["ConnStr"]=this.Context.Request.PhysicalApplicationPath+ConfigurationSettings. AppSettings["... 阅读全文
posted @ 2006-02-20 15:58 .net技術 阅读(160) 评论(0) 推荐(0)
常用代码3[转]
摘要:21.如何设定全局变量 Global.asax中 Application_Start()事件中 添加Application[属性名] = xxx; 就是你的全局变量22.怎样作到HyperLinkColumn生成的连接后,点击连接,打开新窗口? HyperLinkColumn有个属性Target,将器值设置成"_blank"即可.(Target="_blank") 【ASPNETMENU... 阅读全文
posted @ 2006-02-20 15:55 .net技術 阅读(153) 评论(0) 推荐(0)
常用代码2
摘要:11.自定义异常处理 //自定义异常处理类 using System;using System.Diagnostics;namespace MyAppException{ /**//// <summary> /// 从系统异常类ApplicationException继承的应用程序异常处理类。 /// 自动将异常内容记录到Windows NT/2000的应用程序日志 /// </summary> ... 阅读全文
posted @ 2006-02-20 15:53 .net技術 阅读(172) 评论(0) 推荐(0)
常用代码汇总1
摘要:. 打开新的窗口并传送参数: //传送参数:response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="++"’)</script>") //接收参数:string a = Request.QueryString("id");string b = Request.QueryStri... 阅读全文
posted @ 2006-02-20 15:12 .net技術 阅读(165) 评论(0) 推荐(0)
修改datagrid编辑框的宽度
摘要:private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) {for(int i=0;i0) { try { ... 阅读全文
posted @ 2005-07-19 16:18 .net技術 阅读(240) 评论(0) 推荐(0)