資源簡介
nVelocity是一個基于.NET的模板引擎(template engine)。它允許任何人僅僅簡單的使用模板語言(template language)來引用由.NET代碼定義的對象。
當nVelocity 應用于web開發時,界面設計人員可以和.NET程序開發人員同步開發一個遵循MVC架構的web站點,也就是說,頁面設計人員可以只關注頁面的顯示效果,而由.NET程序開發人員關注業務邏輯編碼。nVelocity將.NET代碼從web頁面中分離出來,這樣為web站點的長期維護提供了便利,同時也為我們在aspx之外又提供了一種可選的方案。nVelocity的能力遠不止web站點開發這個領域,例如,它可以從模板(template)產生SQL和PostScript、XML,它也可以被當作一個獨立工具來產生源代碼和報告,或者作為其他系統的集成組件使用。nVelocity也可以為很多web開發架構提供模板服務(template service)。我們的系統就提供一個模板服務的方式允許一個web應用以一個真正的MVC模型進行開發。
代碼片段和文件信息
using?System;
using?System.Data;
using?System.Configuration;
using?System.Collections;
using?System.Web;
using?System.Web.Security;
using?System.Web.UI;
using?System.Web.UI.WebControls;
using?System.Web.UI.WebControls.WebParts;
using?System.Web.UI.HtmlControls;
using?System.IO;
using?NVelocity;
using?NVelocity.App;
using?NVelocity.Context;
using?NVelocity.Runtime;
using?Commons.Collections;
public?partial?class?NVelocityDemo_NVeloctity?:?System.Web.UI.Page
{
????protected?void?Page_Load(object?sender?EventArgs?e)
????{
????????VelocityHelper?vh?=?new?VelocityHelper();
????????vh.Init(@“templates“);
????????vh.Put(“title“?“員工信息“);
????????vh.Put(“comName““成都xxxx里公司“);
????????vh.Put(“property““天營“);
????????vh.Put(“comAddress““四川成都市“);
????????ArrayList?aems?=?new?ArrayList();
????????aems.Add(new?EM(“小李“22“男“));
????????aems.Add(new?EM(“小王“21“女“));
????????aems.Add(new?EM(“小周“22“男“));
????????aems.Add(new?EM(“小瓜“32“男“));
????????vh.Put(“a
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2488??2008-08-20?22:10??nvelocity\NVelocity\App_Code\VelocityHelper.cs
?????文件?????249856??2007-09-20?18:23??nvelocity\NVelocity\Bin\NVelocity.dll
?????文件?????????36??2008-08-20?22:15??nvelocity\NVelocity\Bin\NVelocity.dll.refresh
?????文件?????357496??2007-09-20?18:23??nvelocity\NVelocity\Bin\NVelocity.xm
?????文件????????384??2008-08-18?15:28??nvelocity\NVelocity\NVeloctity.aspx
?????文件???????1779??2008-08-20?22:21??nvelocity\NVelocity\NVeloctity.aspx.cs
?????文件???????1250??2008-08-20?22:43??nvelocity\NVelocity\templates\tp1.htm
?????文件???????1149??2008-08-20?22:18??nvelocity\NVelocity\templates\tp2.htm
?????文件???????7856??2010-04-27?22:36??nvelocity\NVelocity\Web.config
?????文件???????7856??2010-04-28?08:53??nvelocity\Web.config
?????目錄??????????0??2010-04-27?20:41??nvelocity\NVelocity\App_Code
?????目錄??????????0??2010-04-28?08:53??nvelocity\NVelocity\Bin
?????目錄??????????0??2010-04-28?08:53??nvelocity\NVelocity\templates
?????目錄??????????0??2010-04-28?08:53??nvelocity\NVelocity
?????目錄??????????0??2010-04-28?08:53??nvelocity
-----------?---------??----------?-----??----
???????????????630150????????????????????15
- 上一篇:kindeditor編輯器 黏貼圖片自動上傳插件
- 下一篇:58同城同步房源信息
評論
共有 條評論