Executing jquery templates on server.

Aug 29, 2012 at 7:14 PM

Problem I am trying to solve -

We need to generate a printable report. Due to volume of report requested, we need to allow for background report processing.

Proposed solution -

Create a report preview page, since we have very similar page already it would take minimalistic tweaking to create this page.

a. If user wants to print few reports, let them print from preview.

b. If user wants to print a volume, queue the request.

I would like to use preview page to accomplish (b), this requires me to solve two problems -

1. write a view engine render like method to merge model to mvc web form.

2. find a tool which would execute jquery template inserted into this web page.

Questions -

1. Is javascript.net capable of executing jquery template inserted into a web page. Please note that there are ajax calls made, I can kill those if necessary. How can I accomplish this, any sample code would be greatly appreciated.

2. If javascript.net is not the right tool, any recommendations?

Developer
Aug 30, 2012 at 12:31 AM

JavaScript.NET does not include the DOM objects and all the other functions provided by the web browser.  It can only execute pure JavaScript code, and only includes standard JavaScript functions like Math.min().

Mar 26, 2013 at 2:18 AM
I needed to provide a templating engine on the server-side for my CMS. I also want it to execute in a low permission or sandbox environment. Javascriptdotnet was the choice.

Recently did something similar as proof of concept which can be seen in demo here http://phuncms.azurewebsites.net/ . I use vashjs templating, which is similar to razor syntax but does not require the dom.

If you don't need something similar, I would recommend just straight Razor or run nodejs and express on the server-side.