I am trying to develop a method for executing VERY simple asp.net mvc plugins, but basically I'm trying to understand how view rendering works.
I redid my problem before this
public class CustomView : IView
{
public void Render(ViewContext viewContext, TextWriter writer)
{
writer.Write( );
}
}
Now, as part of this recording method, I can display any line in the view, but when I put a line of code wrapped in <%%> there, it renders the code in the view literally, rather than parsing it and executing it. I tried adding things like <% @Page ... to the beginning of the line, and that just does it literally as well.
Among the many attempts that I now call this way as part of the controller action:
...
CustomView customView = new CustomView();
ViewResult result = new ViewResult();
result.View = customView;
result.ViewName = "Index.aspx";
result.MasterName = "";
return result;
What am I missing or is something wrong that this will not work? It seems that ViewResult has a WebFormViewEngine in its ViewEngines collection.
, , , , , , . , - /, , .