James Hollingworth’s Adventures in Code

Icon

Monorail: Get client’s browser

For future reference, to get the clients browser:

    $Context.UnderlyingContext.Request.Browser.Browser

This is infact accessing the HttpRequest.Browser property so you can then get all the usual info like browser version:

    $Context.UnderlyingContext.Request.Browser.MajorVersion

Hope this helps someone!

Filed under: .net, castleproject, monorail, nvelocity ,

Visual Studio syntax highlighting for Monorail views

I was just having a look through the options in visual studio 2008 and noticed a new section for selecting the default editor for non-standard files, such as monorail views (.vm). Up to now i’ve either had to make do with the basic text editor or mess around with the registry, neither of which is that much fun. The dialog is in options -> text editor -> file extension you can then choose what editor you want to associate with each file extension. Hope this is helpful to someone!

Adding monorail views to vs 2008

Filed under: .net, castleproject, monorail, nvelocity, visual studio, visual studio 2008 ,

NVelocity: Get Current Position In ForEach Loop

Just a reminder for myself, To the get the current iteration number in a foreach loop $velocityCount

Filed under: c#, monorail, nvelocity

my bookmarks