castle-monorail

MonoRail Select Using Enum

孤者浪人 提交于 2019-12-24 19:54:45
问题 I've been following this guide and coming up with my own concoction in order to use MonoRail's FormHelper.Select that is generated from an enum. So here's the Brail syntax: ${FormHelper.Select("user.Role", ${LS.EnumToPairs(Roles)}, {"value":"First", "text":"Second"})} "LS" is just my own helper, which I've defined as follows: public IEnumerable<Pair<int, string>> EnumToPairs(Type e) { IList<Pair<int, string>> pairs = new List<Pair<int, string>>(); foreach (int val in Enum.GetValues(e)) pairs

How To: Save a file from a webservice without stopping the page from rendering

天大地大妈咪最大 提交于 2019-12-24 09:35:58
问题 I have a controller with two pages, Index and Download, when clicking download it retrieves a byte[] from the service and I use Response.BinaryWrite to save the file. The problem with this is that when using Response.Clear it stops the Download page from rendering but downloads the file successfully. Is there any way to download the file and render the page? I'm using .NET 4, ASP, Monorail Castle, C# I am aware that by using MVC I am able to use ActionResult and FileResult as return types for

Castle MonoRail & ELMAH

我们两清 提交于 2019-12-21 05:46:36
问题 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/pointers? Cheers, Jay. 回答1: After looking at the links Macka posted, I wrote this simple monorail exception handler: public class ElmahExceptionHandler :

Is it possible to use System.Web.Routing in Castle Monorail?

a 夏天 提交于 2019-12-13 00:38:44
问题 Is it possible to use the Microsoft (or Mono) supplied System.Web.Routing instead of the MonoRail routing stuff when building a Castle MonoRail app for ASP.NET? Any good information on how to implement this as a solution? Pros and cons? 回答1: It is quite possible. You should implement ASP.NET's IRouteHandler that will look up the route data in the given RequestContext , and then hand the data over to MonoRail. That can be done is several ways. I guess that Server.RewritePath will work, but you

Template in monorail ViewComponent

假装没事ソ 提交于 2019-12-11 07:23:58
问题 Is it possible to have a template with html content in vm for a block component? I'm doing a lot of stuff in html, and want the html reside in a .vm, not in codebehind. Here is what i've got: public class TwoColumn : ViewComponent { public override void Render() { RenderText(@" <div class='twoColumnLayout'> <div class='columnOne'>"); // Context.RenderBody(); Context.RenderSection("columnOne"); RenderText(@" </div> <div class='columnTwo'>"); Context.RenderSection("columnTwo"); RenderText(@" <

Automatically HTML Encoding NVelocity Output (EventCartridge & ReferenceInsert)

别来无恙 提交于 2019-12-10 20:07:46
问题 I wanted to try getting NVelocity to automatically HTML encode certain strings in my MonoRail app. I looked through the NVelocity source code and found EventCartridge , which seems to be a class which you can plugin to change various behaviours. In particular this class has a ReferenceInsert method which would seem to do exactly what I want. It basically gets called just before the value of a reference (e.g. $foobar) gets output, and allows you to modify the results. What I can't work out is

Is there an equivalent to Monorail view components for the ASP.Net MVC Framework?

醉酒当歌 提交于 2019-12-06 04:12:02
问题 I make heavy use of View Components in some of the larger applications I've built in Monorail - What is the equivalent approach in ASP.Net MVC for a view component, that can support sections etc.? 回答1: Actually you have several options to create the equivalent of a ViewComponent in ASP.NET MVC, depending in the complexity of your component. I use these two approaches which are the more mvc-ish of the options I am aware of. 1: The simplest thing is to create a ViewUserControl and display it

Is there an equivalent to Monorail view components for the ASP.Net MVC Framework?

夙愿已清 提交于 2019-12-04 12:19:13
I make heavy use of View Components in some of the larger applications I've built in Monorail - What is the equivalent approach in ASP.Net MVC for a view component, that can support sections etc.? Actually you have several options to create the equivalent of a ViewComponent in ASP.NET MVC, depending in the complexity of your component. I use these two approaches which are the more mvc-ish of the options I am aware of. 1: The simplest thing is to create a ViewUserControl and display it using Html.RenderPartial with the helper. The ViewUserControl is a simple piece of markup with no backing

Castle MonoRail & ELMAH

微笑、不失礼 提交于 2019-12-03 20:14:33
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/pointers? Cheers, Jay. After looking at the links Macka posted, I wrote this simple monorail exception handler: public class ElmahExceptionHandler : AbstractExceptionHandler { public override void Process(IRailsEngineContext context) { ErrorSignal.FromCurrentContext

Asp.Net MVC vs Castle MonoRail

℡╲_俬逩灬. 提交于 2019-12-03 03:11:37
问题 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 anyone tells about pros and cons between those? Which ViewEngine is the better as well for overriding the master template? 回答1: Speaking as an advocate of