castle-monorail

From Monorail to ASP.Net MVC

The last time I took on a non-trivial .Net/C# application I used Castle Monorail and, on the whole, enjoyed the experience. Early-access/preview releases of .Net MVC were not yet available. Many "Microsoft shops" will now find the "official" solution more appealing. Has anyone gone from Monorail to .Net MVC. How did you find the switch...

How can I format a javascript date to be serialized by jQuery

I am trying to set a javascript date so that it can be submitted via JSON to a .NET type, but when attempting to do this, jQuery sets the date to a full string, what format does it have to be in to be converted to a .NET type? var regDate = student.RegistrationDate.getMonth() + "/" + student.RegistrationDate.getDate() + "/" + student.Re...

Unit Testing Monorail's RedirectToReferrer()

Hello, I am trying to write a unit test for an action method which calls the Controller.RedirectToReferrer() method, but am getting a "No referrer available" message. How can I isolate and mock this method? Thanks, -- rauchy ...

Is it possible to use Castle MonoRail Routing feature with IIS 5?

Do I have to go with IIS 6 or higher to use Castle MonoRail Routing feature? I know casini work but practically we not gonna deploy web app with casini, or do we? ...

Improving MonoRail

We know it's lacking documentation but what other parts would you like to see improved? ...

CastleProject *.vm HttpForbiddenHandler not work

I try to use HttpForbiddenHandler to block the file without success. The web.config is as follows: <httpHandlers> <add verb="*" path="*.ashx" type="Castle.MonoRail.Framework.MonoRailHttpHandlerFactory, Castle.MonoRail.Framework"/> <add verb="*" path="*.vm" type="System.Web.HttpForbiddenHandler"/> </httpHandlers> I have setup the virtu...

How to fake a validation error in a MonoRail controller unit-test?

I am running on Castle's trunk, and trying to unit-test a controller-action where validation of my DTO is set up. The controller inherits from SmartDispatcherController. The action and DTO look like: [AccessibleThrough(Verb.Post)] public void Register([DataBind(KeyReg, Validate = true)] UserRegisterDto dto) { CancelView(); if...

Is MonoRail ready for productive usage?

Right now I'm not sure... ...

Castle MonoRail & ELMAH

Is anyone using Castle MonoRail and ELMAH with success? We are using a number of Resuces to present users with friendly error messages, but if we do this the exceptions never get as far as ELMAH as the MonoRail rescue intercepts them. Ideally we want the user to see the rescue, but for the exception to be logged in ELMAH. Any ideas/po...

Castle MonoRail Routing with IIS 7?

I’m trying to make the routing module works with default action or controller, but it doesn’t. I always face with 404 page not found. Did I forget to do something? I really like routing in ASP.NET MVC feature, but I’m not sure I could do the same in MR. I’m using IIS7 with the build from castle trunk for .NET 3.5. ...

Asp.Net MVC vs Castle MonoRail

I've some experiences on build application with Asp.Net, but now MVC frameworks become more popular. I would like to try building new multilingual web application using with Asp.Net MVC or Castle MonoRail but I don't know which one is good for me. I don't like the web form view engine, but I like routing feature in Asp.Net MVC. Could a...

How to get Castle MonoRail's DataBinder/SmartDispatcherController to bind against types containing properties that are interfaces?

We're using interfaces to represent entity classes in our domain model. We have concrete implementations of these by virtue of using LinqToSql. We have added a factory method to each LinqToSql class which our service layer uses to instantiate a new entity (note; as opposed to the controller's DataBind attribute doing it). MonoRail's d...

Problem with NVelocity, foreach and two Lists

Hi, is there an easy way to solve the following problem. Let's say I fetch a IList with some books in my controller from my model. Now I want to enrich the output and fetch a preview from Amazon with another model from an outside framework and get another IList. Now I put both ILists into a property bag. In NVelocity I use a #foreach...

Could we use with and without extension on different actions in MonoRail?

I would like to build a web application on Castle MonoRail, I was wondering how can we use an action with extension and another action without extension? How can HTML helper generator url for us? Ex: http://mysite.com/Products/list http://mysite.com/Products/abc.castle ...

Service Layers and Repositories

I've been using MVC frameworks for a short while now and I really like how the concerns are separated out. I've got into a bad habit of letting the controllers do quite a bit of work. So I'm really looking for some advice. When I first started using MVC I quite often had the controller doing manipulation on the models after database w...

How to figure out which timezone a (ASP.NET / MonoRail) website user is in?

So, I'm setting a cookie that should expire. However, I want this to work around the world. So I need to adjust my expiry date for the user's timezone. So, I need to find out the user's timezone, server-side. Is there a way to do this in the BCL? As in, something like relying on the CultureInfo.CurrentUICulture to be set correctly...

Gzip compression using IIS6.0 for files without an extension

Has anyone managed to activate Gzip compression on a website in IIS6 ? We're using Castle Monorail (it's very nice btw) and as a result have clean RESTful URLs with no extensions..... ..... and there's the rub -> as far as we can see we need extensions on our endpoints to allow gzip compression. It seems the only way out is our own HTTP...

Is there a LINQ Equivalent for ARDatabind in ASP MVC.net?

Is there any attribute that one can put on a parameter for an action that tells LINQ to load a particular entity and only databind on the values that have changed a la Active Record/Monorail (see ARDataBinding) ...

MonoRail redirect to # anchor

I'm using Castle Monorail with jQuery tabbed navigation. When handling a controller action, I would like to redirect to a view, and control which tab is visible. Therefore, I'd like to have my controller redirecting to a specific anchor in a view, something along the lines of: RedirectToAction("Edit", "id=1", "#roles")); Resulting in...

Force the browser to cache a request to a Castle MonoRail action?

In our project, we have a whole bunch of small css/js files, so when we build views we find ourselves writing many <link> or <script> tags, forcing the browser to make many requests for our css/js content. To remedy this, we started looking for a way for server to shore that all up into one request that dumps every css file or every js ...