views:

87

answers:

1

Hi all,

I am struggling with WiewUserControls. What I want to accomplish is View without knowledge of which usercontrol have to call with RenderPartial in order to render some html.

What I want instead is to give some kind of IViewEngine interface and then View can only call on certain place in template methods of IViewEngine that will render content.

any ideas?

A: 

You could take a look at StringTemplate, which is a pure MVC templating engine. It has a C# port, with a ASP.NET View under construction.

Kamiel Wanrooij
thank you Kamiel, it is nice solution what bothers me and is not solved with that approach is that my controller and the view are not separated...What I want is third part, an object that I can configure from controller and then pass to view and view only to call methods on that object for rendering
Marko
I think StringTemplate can fulfill that duty. I am not sure what your exact use case is, but with this tool you can configure an object in your controller, and use it in your view, independent of each other if necessary. It does break with the traditional ASP.NET flow, though.
Kamiel Wanrooij