Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6733673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:47:50+00:00 2026-05-26T10:47:50+00:00

Problem: Given this nested layout structure: ~/Views/Shared/_layoutBase.cshtml ~/Views/Shared/_layout.cshtml Where _layoutBase.cshtml is the layout for

  • 0

Problem:

Given this nested layout structure:

~/Views/Shared/_layoutBase.cshtml
~/Views/Shared/_layout.cshtml

Where _layoutBase.cshtml is the layout for _layout.cshtml.

Any sections defined in the layout files render their content fine in pages under ~/Views/...

However, for views in an area, the sections are never rendered.

Setup:

_layoutBase:

<script type="text/javascript">
        @RenderSection("footerScripts", false)
    </script>
</body>
</html>

_layout.cshtml:

@section footerScripts{
    @RenderSection("footerScripts", false)
}

"content" view:

@section footerScripts{
$(function () {
    SetFocusOnForm("CaptchaCode", "NextButton");
});
}

The content of section footerScripts never gets rendered in a view in an area. It does get rendered in a view that is under the ~/Views folder.

Area _ViewStart.cshtml:

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
} 

Question:

Can you see anything wrong?!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:47:51+00:00Added an answer on May 26, 2026 at 10:47 am

    I am unable to reproduce the problem. Here’s my setup and steps I did.

    1. Create a new ASP.NET MVC 3 application using the Internet Application Template
    2. Add ~/Views/Shared/_LayoutBase.cshtml:

      <!DOCTYPE html>
      <html>
      <body>
      @RenderBody()
      <script type="text/javascript">
          @RenderSection("footerScripts", false)
      </script>
      </body>
      </html>
      
    3. Replace the contents of ~/Views/Shared/_Layout.cshtml with this:

      @{
          Layout = "~/Views/Shared/_LayoutBase.cshtml";
      }
      
      @section footerScripts{
          @RenderSection("footerScripts", false)
      }
      
      @RenderBody()
      
    4. Right click on the project and add an Admin area

    5. Add a TestController to this admin area and add a corresponding ~/Areas/Admin/Views/Test/Index.cshtml view:

      @{
          ViewBag.Title = "Index";
          Layout = "~/Views/Shared/_Layout.cshtml";
      }
      
      <h2>Index</h2>
      
      @section footerScripts{
          alert('ok');
      }
      
    6. Run the application and navigate to /admin/test/index
    7. The alert is shown
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to solve this problem : http://uva.onlinejudge.org/external/7/732.html . For the given example, they
I recently came in contact with this interesting problem. You are given a string
The essence of the problem is, given a class hierarchy like this: class A
Can someone give me a simple example involving threads in this manner, please. Problem
I'm hoping someone has run into this sort of problem before, and can give
This is inspired by/taken from this thread: http://www.allegro.cc/forums/thread/603383 The Problem Assume the user gives
Problem: Given a list of strings, find the substring which, if subtracted from the
Problem Given the following two tables, I'd like to select all Ids for Posts
Here's the jist of the problem: Given a list of sets, such as: [
First the practical application that led me to the problem: Given a set of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.