Friday, February 02, 2007

MonoRail - Web MVC model on ASP.NET

MonoRail is a MVC Web Framework inspired by Action Pack.

1. Download MonoRail from here.
2. If there's error "Project type not support" error while opening a MonoRail web project occur, download VS 2005 SP1 here.
3. Download a complete Castle Monorail sample project here.
4. In IIS, associate the extension you want to use (.rails) for MonoRail with ASP.Net ISAPI(aspnet_isapi.dll).
5. Deploying the application
To deploy, simply copy your webapp's bin and Views directory as well as Global.asax and your web.config files to /web/test and then you can point your browser at http://yourserver.com/test/index.rails.

Castle+iBatisNet+MonoRail
Castle+iBatisNet+Castle.MVC+ASP.NET

NVelocity engine

Change a library project to web project:
the simple way is open the .csproj in Notepad and change the line
<ProjectType>Local< /ProjectType>
to
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}< /ProjectTypeGuids>

Some link:
Intro to MonoRail (cn)
Implement page cache for MonoRail (cn)
Use NDO in MonoRail (cn)
TerryLee's Castle Series
NDO
Castle ActiveRecord Issues
DotNet软件开发框架
基于Castle+IBatisNet+Castle.MVC的ASP.NET构架
使用IBatisNet + Castle 开发DotNet软件
IBatisNet+Castle构架开发指南 (续) 附代码生成模板
Asp.Net中获取Castle容器中的服务的另一方法

Thursday, February 01, 2007

Templates Based Web Application

I'm searching templates based web application design tech.

First, I come to XOOPS. It is an extensible, OO (Object Oriented), easy to use dynamic web content management system written in PHP. It use Smarty engine, which take the template, parse it, and ouput .php file as result, some tags:
〈{if ...} >
〈{/if} >
〈{foreach ...>
〈{/foreach}>

Then, I found Shopify , which support customized layout and theme for each register store. In their admin pages, owner can change the liquid for template. Actually Shopify use Ruby on Rail and Mephisto Templates., some tags:
{% if ... %}
{% endif %}
{% for ... in ... %}
{% endfor %}

In .Net platform, there are 4 template engine: Web Forms, NVelocity, Brail, StringTemplate. Here's comparisson. And MonoRail:View Engines Book also has some information.

In ASP.Net, we can loading user control as a ItemTemplate to accomplish similar work. This article give us a example to create templates dynamically in a DataList web server control like:
Repeater1.ItemTemplate = Page.LoadTemplate("usercontrol.ascx")

Using AJAX, the client can update certain part of the page. The data used to update the client can be a string, or even a rendered ouput of a user control,
ScottGus Blog show us Cool UI Templating Technique to use with ASP.NET AJAX for non-UpdatePanel scenarios.

Alexander Kleshchevnikov, defined his email template tags and implement a parser in vb.net.