Created
March 20, 2014 14:35
-
-
Save nberardi/9665119 to your computer and use it in GitHub Desktop.
Example For Flushing Before Execution for Nik Molnar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HomeController : Controller { | |
public ActionResult Index () { | |
ViewBag.ExecuteAction = () => { | |
// do stuff here | |
return model; | |
}; | |
return View(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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