November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
https://weblogs.asp.net/scottgu/asp-net-mvc-3-layouts-and-sections-with-razor
MVC Section can be your friend.
/K
(Generally speaing, Blocks is a resuable component, Ideally, should not be used to render scripts)
If I am understanding it correctly, you will require to create a flag at rootlayout level to decide rather to render particular style or not rather at Block level.
Please see http://dodavinkeln.se/post/how-to-inject-a-script-for-a-block. But instead of using .AtFooter(), use .AtHeader(). Also use RequireStyle instead of RequireScript.
@Johan Cool, I have never tried this for blocks before as I probably have missed your blog :), just wondering, If its a collection of blocks on a page? will that script be included mutiple times?
/K
You have not missed it, since you actually commented on it :)
No it will only be added once. You can also set up dependencies, so it's added before another resource and that they're added as well.
Hi!
I am wondering if it's possible to render