ASP.Net MVC Preview 2 with Delphi 2007

by John 3/12/2008 9:13:00 PM

I have just started exploring preview 2 of the new ASP.Net mvc framework with Delphi 2007.  I have created a project template to help me get started, I'm guessing other people might like it so I have uploaded it to CodeCentral and it can be found here.

If you decide you would like to give it a try your going to need to have installed a couple of things beforehand.

ASP.Net MVC Preview 2 and

the dotnet framework v3.5 

You need to extract the copy of the zip file in codecentral to some location on your harddrive and add ASPNETMVC.bdstemplatelib as a template reference to the IDE. The zip file contains a starter project.

I have more information about project templates here


Once installed into the IDE you should be able to select ASP.Net MVC WebApplication from the new items dialog.

This is shown below


The project template is based on the existing ASP.Net web application one with a few changes.

The most noticeable difference is that I have created three folders, models, controllers and views.  Its a good idea to head over to the mvc website to gain an understanding of the conventions followed when using the mvc framework.

Another less obvious change is that the two aspx files in the views subfolders are derived from ViewPage in the System.Web.MVC namespace.

Below is a sample project created with the template.


The next two screenshots show the designer and codebehind for the view home.aspx 

Notice the class that the page is derived from


The final changes are the addition of a Global.asax to the project and a few updates to web.config


Below is an example of MVC Contrib using the Brail View Engine



Currently rated 3.0 by 1 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Brail | aspnetmvc | Delphi | ASP.Net 3.5 | MVCContrib

Related posts


3/15/2008 3:56:51 PM

Wonderful post, except the title. It should be CodeGear RAD Studio 2007. IMHO, Delphi 2007 refers to Delphi 2007 for Win32 which does not contain Delphi for .NET personality.

Lex Y. Li

3/23/2008 7:20:17 PM


How can this be modified to be used with & ECO?


3/24/2008 6:20:37 AM


I would create a new ECO webform application with the model in a separate package. Then move the ecospace and persistancemapperprovider into the model package.

Finally replace the web application with a project created using the aspnet mvc project template.

When your developing functionality you follow the pattern used in my eco mvp example.


3/27/2008 11:22:47 AM

How MVC Contrib library can be used with Delphi 2007?
There's lots of stuff based on extension methods and lambdas which is just not supported in Delphi 2007.

It would be great to see an example translated to Delphi.

For example, how routing and ActionLink Helper can be used in Delphi (

This is one of the most important things but in Delphi it might be worthless.
For example, how is it possible to generate typed link with ActionLink this way:

Html.ActionLink("Search Drinks", s=>s.Results("Juice", 2))

So generating a template is just not a prove of ability to use ASP.NET MVC with Delphi.

Castle MonoRail should be much more suitable for using with Delphi until it will start supporting .NET 3.5 features.

Nevertheless, it's a good start.

Dmitriy Nagirnyak

3/27/2008 12:40:21 PM

Hi John,

It's nice to see the blog updated.

I don't see a problem in using Brail or NVelocity engines (supported by MVCContrib).

I also don't see a problem *creating* routes in D2007.

I rather see problems in *using* all the extensions already available in MvcContrib (particularly for routes, which are becoming a part of .NET core).

Maybe with Delphi Class Helpers it would be possible to overcome it, but I'm really not sure.

It seems for me that ASP.NET MVC without Extension methods and Lambdas (which probably is the case with D2007) is just a MonoRail.
Which is much more mature and stable than ASP.NET MVC (at this moment is Preview 2).

What do you recon about MonoRail?

Looking forward for more articles about Delphi + MVC from you.

BTW, you can add your 2 cents about MVC Framework here:


Dmitriy Nagirnyak

3/27/2008 1:13:13 PM


I've updated the blog post to include an example of the Brail View engine that was ported from the mono project and sits inside mvccontrib.

I've been creating routes using property assignments. For example


blogPostingContraints := RouteValueDictionary.Create;

I don't think it would be possible to use the extension methods but I would imagine you could do something similar with Delphi Class Helpers.


Comments are closed

Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

Name of author John Moshakis
I'm a software developer living in Toronto..

E-mail me Send mail


<<  August 2022  >>

View posts in large calendar


    Recent posts

    Recent comments



    Don't show


      The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

      © Copyright 2022

      Sign in