Render ViewComponent from another component codebehind
Posted
by George Polevoy
on Stack Overflow
See other posts from Stack Overflow
or by George Polevoy
Published on 2010-05-05T19:45:57Z
Indexed on
2010/05/06
5:58 UTC
Read the original article
Hit count: 219
castle-monorail
|.NET
I'm trying to render a component from withing another component.
public override void Render()
// ...
var block = new Block();
block.Init(EngineContext, Context);
block.Render();
// ...
}
The problem is that Block component can't find it's template.
ResourceProcessingException Message: Unable to process resource 'components\CustomReportComponentComponent\default.vm': Resource could not be located
I guess, other problems can arise because the component is not properly initialized.
Is it possible to initialize a component from within another component's Render method, so it renders just as if called from a .vm?
© Stack Overflow or respective owner