What is the ASP.NET MVC equivalent of "override void render" from ASP.NET WebForms? Where can you do the last minute processing before sending the sender to the customer?
For example, I would not use it in production code, but it illustrates the layout clean <title>
and <head>
for the entire site when placed in MasterPage WebForms applications.
protected override void Render(HtmlTextWriter writer)
{
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
base.Render(htw);
htw.Close();
string h = sw.ToString();
string fhtml = h.Replace("<title>\r\n\t", "\n<title>")
.Replace("\r\n</title>", "</title>")
.Replace("</head>","\n</head>");
writer.Write(fhtml);
}
What is the best way to play with final text rendering in ASP.NET MVC?
UPDATE:
Therefore, looking at the link (diagram) that Andrew Hare mentioned, it looks like you can do it in the View Engine. Can you point something at or change the default way Engine Engine works, or do you need to replace all of this?