0

I want to use "NVelocity" from plain ASPX pages without using any MVC framework. I don't want to use "NVelocity View Engine" thru' asp.net MVC framework. The only example that I got for "NVelocity" is for merging and writing onto console window (http://www.castleproject.org/others/nvelocity/usingit.html)

I am looking out for example on to integrating "NVelocity" into aspx web forms. Any pointers would be really helpful.

CleanBold
  • 1,551
  • 1
  • 14
  • 37
  • You mean you want to use NVelocity *instead* of ASPX, in WebForms, right? – Mauricio Scheffer Feb 01 '11 at 12:30
  • I mean, I want to transform some *.html pages using NVelocity in my .net web application. There are other aspx pages in my web app which would function in normal way as asp.net engine processes them. – CleanBold Feb 03 '11 at 09:47

1 Answers1

1

I found a way. The idea is the override Page.Render() method in an aspx page. Write the code in Render() method to transform the HTML template (I mean, *.html file or *.aspx file) using NVelocity. Pass HTMLTextWriter object while merging the template and context "template.Merge(context, writer);"

This will render the transformed HTML to web browser.

CleanBold
  • 1,551
  • 1
  • 14
  • 37