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 9209531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:51:54+00:00 2026-06-18T00:51:54+00:00

ASP.NET MVC4 only showing @RenderBody content on IIS7 Setup: I’ve got a VM running

  • 0

ASP.NET MVC4 only showing @RenderBody content on IIS7

Setup: I’ve got a VM running Windows 7 upon which I’ve installed IIS7, MVC3 & MVC4 with Web Platform Installer. I’ve added a new website in IIS using a .NET 4.0 application pool, and then used the Visual Studio 2012 publish option to publish an MVC4 web app to the website’s root directory.

The problem is that the only output I am getting is whatever is in the individual views. There is no layout, nothing other than the @RenderBody content.

It works fine when I preview it with Visual Studio.

This is my _Layout.cshtml:

    <!DOCTYPE html>
    <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
    <!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
    <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width" />
        <title>@ViewBag.Title</title>
        <link rel="shortcut icon" type="image/x-icon" href="~/favicon.ico">

        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")
    </head>
    <body>
        <!-- this is decorative -->
        <div class="topbar"></div>

        <div class="row header">
            <div class="five columns logo">            
                <a href="@Url.Action("Index", "Home")">
                    <img src="@Url.Content("~/Content/images/logo.png")">
                </a>
            </div>
            <div class="seven columns nav">
                @Html.Partial("_TopNavigationPartial")
            </div>
        </div>

        @RenderBody()

        <div class="row">
            <div class="twelve columns box-padding">
                <div class="box">
                    <div class="row footer">
                        <div class="six columns copyright">&copy; 2013 snip.</div>
                        <div class="six columns nav">
                            @Html.Partial("_BottomNavigationPartial")
                        </div>
                    </div>
                </div>
            </div>
        </div>

        @Scripts.Render("~/bundles/jquery")
        @RenderSection("scripts", required: false)     
    </body>
    </html>

All that will be output though is what is in the view, e.g:

    <div class="row">
        <div class="twelve columns box-padding">
            <div class="box">
                <h1>Home</h1>
                <p>You are here: Home/Index</p>
            </div>
        </div>
    </div>

Anyone have any idea why this might be so?

It’s probably just that I haven’t set up IIS7 right.

Edit: I just uploaded the Internet application and it has done the exact same thing. Only the view content is being output. So it’s definitely something in IIS.

Edit 2: I have set up an Internet application as an application in IIS but still it returns the view content only. Weird.

Edit 3: Got it working, not sure how. https://i.stack.imgur.com/8DCug.gif

  • 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-06-18T00:51:55+00:00Added an answer on June 18, 2026 at 12:51 am

    Managed to fix this. Not sure exactly what was the problem, but I was making a new website and then dragging the published files into it, which wasn’t working.

    I then added an application to the default website, which worked, but then I found this post which explained that the default website itself is an application.

    So in the end I just copied the published files into the default root directory and it worked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC4 site with mobile content. When I deploy this on
I have an ASP.NET MVC4 app which uses DotNetOpenAuth 4.0.1 to authenticate users with
My code is in ASP.Net mvc4 . in this only label is coming not
I'm trying to implement Forms Authentication in ASP.NET MVC4 application and I've only one
I'm creating an ASP.NET MVC4 application which has a left menu panel, and the
I've got an old Windows 2003 server running IIS 6, and I chose .net
In ASP.net MVC4 there's this 'new' concept of a web API for exposing CRUD
I just started learning ASP.NET MVC4 today. After reading tutorials, downloading VS 2012, and
I have a simple asp.net MVC4 / EF 4.1 project created with VS 2011,
My web application is ASP.NET MVC4 with Razor and Knockout.js. The view model hierarchy

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.