上一页 1 ··· 8 9 10 11 12 13 14 15 下一页
为了方便的访问数据,微软自己封装了一个数据访问模块, 即Data Access Application Block. 通过它,我们用来访问数据库的编码量大大减少了. 这样的代码既有效率,又减少了出现错误的几率,其益处是可见的. 下面举两个例子比较一下 1. 使用一般的sql语句进行控件绑定, 常规代码如下: 1//Create the connection and sql to be executed2string strConnTxt = "Server=(local);Database=Northwind;Integrated Security=True;";3stri Read More
posted @ 2009-08-05 10:18 汉卿 Views(177) Comments(0) Diggs(0) Edit
1、在Head中放入js代码 <SCRIPT LANGUAGE="javascript">function winSizer(){windowWidth = window.screen.availWidth;windowHeight = window.screen.availHeight;window.moveTo(0,0);window.resizeTo(windowWidth,windowHeight);}</SCRIPT> 2、在body中调用js<body onLoad="winSizer()"></bo Read More
posted @ 2009-08-04 12:55 汉卿 Views(393) Comments(0) Diggs(0) Edit
Page.ClientScript.RegisterStartupScript( this.GetType(), "js", string.Format("alert('return:{0}')", rtn.ToString()), true); Read More
posted @ 2009-08-03 13:29 汉卿 Views(147) Comments(0) Diggs(0) Edit
AJAX / AJAX框架 / AJAX.NET (Professional) / ASP.NET AJAX LINQ / LINQ to SQL / LINQ to XXX Lambda Expression / Expression Tree / 匿名方法AJAX / AJAX框架 / AJAX.NET (Professional) / ASP.NET AJAX 这是我见过的混淆最多的一组概念。不过当去年AJAX技术如火如荼,AJAX框架层出不穷,而微软又推出ASP.NET AJAX框架之后,这四个概念之间的混淆也愈发严重起来了。我经常能看到这样的问题: ... Read More
posted @ 2009-08-03 13:09 汉卿 Views(194) Comments(0) Diggs(0) Edit
在ASP.NET中管理脚本,正是System.Web.UI.ClientScriptManager类的特长。ClientScriptManager类通过Page.ClientScript暴露。在控件内部,可以通过this.Page.ClientScript得到ClientScriptManager实例。 ClientScriptManager类提供了大量生成客户端代码的方法: — RegisterArrayDeclaration——添加一个JavaScript数组到页面中。 — RegisterClientScriptBlock——在页面的起始<form>标签后添加JavaScri Read More
posted @ 2009-08-03 11:32 汉卿 Views(256) Comments(0) Diggs(0) Edit
使用ASP做网站虽然有点落伍,但在中国还是有很大市场的,因为大部分国内用户使用Windows Server服务器,在Windows Server的IIS环境下,ASP+SQLServer的性能丝毫不逊于PHP+MySQL,可惜ASP不支持跨平台,不支持Apache,因此发展受到了很大限制。在开源项目上,国内的ASP开源项目也没有PHP的多,不过也有一些,下面是我总结的一些基于ASP的建站开源系统。 论坛:DVBBS 动网论坛曾经是国内很流行的论坛,不过后来逐步衰落,在大用户量访问下,其性能不如Discuz和PHPWind。 博客平台:Z-BLOG Z-Blog是一套基于ASP平台的开放... Read More
posted @ 2009-08-01 13:01 汉卿 Views(754) Comments(0) Diggs(0) Edit
partial关键字 C#2.0提供的新关键字,用来将一个class、struct或interface的定义拆分,写在不同的源文件中。每个源文件包含类定义的一部分,编译应用程序时将把所有部分组合起来。在以下几种情况下需要拆分类定义: 1.处理大型项目时,使一个类分布于多个独立文件中可以让多位程序员同时对该类进行处理。 2.使用自动生成的源时,无需重新创建源文件便可将代码添加到类中。Visual Studio 在创建 Windows 窗体、Web 服务包装代码等时都使用此方法。无需编辑 Visual Studio 所创建的文件,便可创建使用这些类的代码。 用法如下: [modifiers] pa Read More
posted @ 2009-08-01 11:31 汉卿 Views(517) Comments(0) Diggs(0) Edit
如题。 Read More
posted @ 2009-08-01 11:26 汉卿 Views(158) Comments(0) Diggs(0) Edit
using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Xml.Linq;using System.Collections.Generic;using System.Data.SqlClient; namespace DAL{ public class GetCon { private static SqlConnection conn; private static SqlDataAdapter da; private s Read More
posted @ 2009-08-01 11:19 汉卿 Views(1085) Comments(0) Diggs(0) Edit
using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace IBLL{ public class GetRedirect { public GetRedirect() { } public const string WINALERT = "<script>alert('{0}');</script>"; public const string REDIRECT = "<script>doc Read More
posted @ 2009-08-01 11:18 汉卿 Views(193) Comments(0) Diggs(0) Edit
上一页 1 ··· 8 9 10 11 12 13 14 15 下一页