Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example For Flushing Before Execution for Nik Molnar
public class HomeController : Controller {
public ActionResult Index () {
ViewBag.ExecuteAction = () => {
// do stuff here
return model;
};
return View();
}
}
<html>
<head>
@* some scripts and other things here *@
</head>
<body>
<h1>My awesome page</h1>
@{ Response.Flush() }
@{ var model = ViewBag.ExecuteAction(); }
<h2>@model.Title</h2>
<p>@model.Content</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.