I sent Louis Dejardin a message through the Spark site this morning to
explain an issue. Per his suggestion I have set up a gist repository
of a sample project demonstrating my issue here:
https://gist.github.com/1830082
What we are trying to do is use spark in a standalone application
(possibly a build task soon) to render out fixtures for our javascript
unit tests directly from the existing spark files. I pointed this
console application at a number of partials and full pages with master
layouts and didn't have any issues. However, when I started working
with a sample form from our application I encountered an issue I can't
seem to resolve.
In order to Render the View I need to set up a ViewContext and
HtmlHelper. In the process of doing that I use some mocked objects,
but most importantly I pass a TextWriter into the constructor of the
ViewContext. I then call RenderView and I'm also passing in the
TextWriter there. What seems to be occurring is that these are
writing to the file distinctly. What ends up happening is my
BeginForm extension writes the opening and close tags for the Form to
the file before any of the other content is written in. The view
renders fine when using the spark view engine through our site and
looking at it in the debugger I don't see the same issue with the
TextWriters.
Clearly I'm doing something wrong with how I'm setting up my engine or
more likely my view. The key files to see what I'm doing in my code
are FixtureProvider.cs and ViewProvider.cs.
We are, of course, happy to entertain any suggestions for best
practices although please understand that this is a bit of work in
progress for us. Obviously our primary concern is figuring out what
we aren't doing correctly in setting this up as a standalone to render
our fixtures.
thanks!
Miles
Miles
--
You received this message because you are subscribed to the Google Groups "Spark View Engine Dev" group.
To post to this group, send email to spar...@googlegroups.com.
To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spark-dev?hl=en.