摘要: usingNVelocity;usingNVelocity.App;usingNVelocity.Runtime;VelocityEnginevltEngine=newVelocityEngine();vltEngine.SetProperty(RuntimeConstants.RESOURCE_LOADER,"file");vltEngine.SetProperty(RuntimeConstan... 阅读全文
posted @ 2009-05-14 09:28 awp110 阅读(808) 评论(1) 推荐(0) 编辑
摘要: 我喜欢在Asp.Net MVC中使用NVelocity View Engine的一个很重要的理由就是:NVleocity简洁易用的语法。几乎使用#set,#if,#foreach就可以构成完整的应用,下面就介绍一下NVelocity中的语法及常用指令。默认情况下,NVelocity解析是不分大小写的,当然可以通过设置runtime.strict.math=true,采用严格解析模式。对变量的引用:... 阅读全文
posted @ 2009-05-14 09:25 awp110 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 一、NVelocity介绍 1.1 Velocity是什么nVelocity是一个基于.NET的模板引擎(template engine)。它允许任何人仅仅简单的使用模板语言(template language)来引用由.NET代码定义的对象。当nVelocity 应用于web开发时,界面设计人员可以和.NET程序开发人员同步开发一个遵循MVC架构的web站点,也就是说,页面设计人员可以只关注页面... 阅读全文
posted @ 2009-05-14 09:19 awp110 阅读(194) 评论(0) 推荐(0) 编辑
摘要: OBJECT作参数时是传址的(就是你说的传引用)String虽然是引用类型,但是当参数使用时你要当作是传值,不是传址,就对了。其它基本类型都是传值的 我一直想当然的认为 两个String 类型如果用 == 操作符比较,将比较其引用。所以如果两个String引用不同,则只能使用Equal 来比较它们是否相等。 比如下面语句[代码] 如下方法比较其引用 Console.WriteLine((obje... 阅读全文
posted @ 2009-05-14 08:48 awp110 阅读(391) 评论(0) 推荐(0) 编辑
摘要: //子节点 Expo.Database.SqlGen mycmd = new Expo.Database.SqlGen(); protected void Page_Load(object sender, EventArgs e) { IList<string> path = new List<string>(); GetPath(2, ref path); foreac... 阅读全文
posted @ 2009-05-13 11:08 awp110 阅读(367) 评论(0) 推荐(0) 编辑
摘要: --建立測試環境Create Table A(IDInt,fatherIDInt,NameVarchar(10))Insert A Select 1, NULL, 'tt'Union All Select 2, 1, 'aa'Union All Select 3, 1, 'bb'Union All Select 4, 2, 'cc'Union All Select 5, 2, 'gg'Union ... 阅读全文
posted @ 2009-05-11 07:08 awp110 阅读(1727) 评论(2) 推荐(0) 编辑
摘要: 函数CREATE FUNCTION GetChildren (@id varchar(20))RETURNS @t table(id varchar(20)) AS BEGIN insert @t select subid from tree where parentid = @id while @@rowcount > 0 insert @t select a.subid from tr... 阅读全文
posted @ 2009-05-11 07:03 awp110 阅读(455) 评论(0) 推荐(0) 编辑
摘要: [代码] 阅读全文
posted @ 2009-05-10 21:53 awp110 阅读(162) 评论(0) 推荐(0) 编辑
摘要: NVelocity现在属于Castle项目,相关介绍:http://www.castleproject.org/others/nvelocity/index.html使用方法:http://www.castleproject.org/others/nvelocity/usingit.html发现很多人在按上面的方法使用时会出现Unable to find resource"xxx"错误解决办法:在... 阅读全文
posted @ 2009-05-09 14:05 awp110 阅读(1959) 评论(0) 推荐(0) 编辑
摘要: 这个是直接输入到页面上。如果我们不直接输出到页面上,而是把它写入到一个文件中呢?生成静态页--是的,这是让大家都心动的。 下面的代码是我第一个练习:[代码] 阅读全文
posted @ 2009-05-09 13:18 awp110 阅读(1093) 评论(1) 推荐(0) 编辑