ClientResources.RequireScript().AtFooter() not working


What area name does the .AtFooter() method look for? I have @Html.RequiredClientResources("Footer") in my master page, but my script is added to the page even when using .AtFooter(). The only documentation I can find on this whole feature shows the use of @Html.RequiredClientResources(RenderingArea.Footerbody) but I can't find anywhere where RenderingArea.Footerbody is defined.

Oct 09, 2015 0:44

looks correct to me. Make sure that you've put '@Html.RequiredClientResources("Footer")' at the bottom of the layout view though, as the scripts will be rendered at the location where you've put it.

Oct 09, 2015 8:57

Thanks for your response, Per. I have declared the footer area just before the closing body tag. Here is some of my markup:

_Blank.cshtml Layout:

    <meta name="viewport" content="width=device-width" />
    @Html.RequiredClientResources("Header") @*Enable components to require resources. For an example, see the view for VideoBlock.*@


@model PageViewModel<CampWeekAdminPage, CampWeekAdminViewModel>

    Layout = "~/Views/Shared/Layouts/_Blank.cshtml";

    var cwVM = Model.ViewModel;

Yesterday, right before I left, the script was appearing in the <head> section when rendered, even after rebuilding the project and doing a hard refresh on the page. Now, when I just ran it to confirm it's not working, it's now appearing at the footer. Something must have been cached. Where or how it got cleared, I don't know. Thanks for confirming all was correct.

Oct 09, 2015 17:49
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.