I use BaseUserControl, where I have a method
private string typeName
{
get { return GetType().FullName; }
}
private object headOne
{
get { return Context.Items[typeName + "_Head"]; }
set { Context.Items[typeName + "_Head"] = value; }
}
public void Head(Action template)
{
if (headOne == null)
{
template();
headOne = "exist";
}
}
I use it for now, to not duplicate one user control part. Inside action I have couple Request.Write();
<% Head(() => { %>
<style>.css {}</style>
<% }); %>
What I am interested, hot to execute this Request in a Head tag. For now I didnot find any way, without creating custom view engine.