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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:54:51+00:00 2026-05-23T13:54:51+00:00

I am faced with a problem with ASP.NET MVC 3 with the Razor rendering

  • 0

I am faced with a problem with ASP.NET MVC 3 with the Razor rendering engine (C#). I am using multiple Html.RenderAction() methods within a view and only the layout is rendered.

One important note before continuing: I can’t copy any of the code because I do not have the intellectual property rights to do so. 🙁

Anyway, I noticed that if I used the following syntax @{ RenderSection("SectionName", true); } instead of @RenderSection("SectionName", true) there was a generic exception that simply says that it was unable to render the sections with a stack trace that seemed to say that there might be some asynchronous problem. Between, I am using synchronous controllers so maybe this is a lead, but I don’t know much on synchronous/asynchronous controllers and when one should use them for certain situations.

To put everything in context, here is what I am trying to do in code/pseudo code/site structure…

~/View/Shared/_ViewStart.cshtml

(Selects a layout according to certain conditions.)

~/View/Shared/_Layout1.cshtml

<! doctype HTML>
<html>
    <head>
        <!-- some irrelevant content here... -->
    </head>

    <body>
        <div id="page">
            <div id="header">
                @RenderSection("Header", true)
            </div>

            <div id="content">
                <div id="main1">
                    @RenderSection("Table1", true)
                    @RenderSection("Table2", true)
                </div>

                <div id="main2">
                    @RenderSection("Content", true)
                </div>
            </div>

            <div id ="footer">
                @RenderSection("Footer", true)
            </div>
        </div>
    </body>
</html>

~/View/Shared/_Layout2.cshtml

(another layout)

~/View/Controller1/Action1.cshtml

@section Header
{
    @RenderPage("~/Views/Shared/Sections/Header")
}

@section Footer
{
    @RenderPage("~/Views/Shared/Sections/Footer")
}

@section Table1
{
    @{ RenderAction("Table1", "Table");  }
}

@section Table2
{
    @{ RenderAction("Table2", "Table");  }
}

@section Content
{
    @{ RenderAction("Action", "Content"); }
}

~/View/Controller1/Action2.cshtml

(similar to Action1.cshtml)

~/Utilities/ModelManager.cs

public abstract class ModelManager : Controller
{
    //Some useful code for controllers here...
}

~/Controller/Controller1.cs

public class Controller1 : ModelManager
{
    #region Get Methods

    public ViewResult Action1()
    {
        return View();
    }

    public ViewResult Action2()
    {
        return View();
    }

    #endregion  

    #region Post Methods

    public ViewResult Action1(FormCollection form)
    {
        return View();
    }

    public ViewResult Action2(FormCollection form)
    {
        return View();
    }

    #endregion
}

~/Controller/Controller2.cs

(another controller similar to Controller1)

~/Controller/Table.cs

(Only important thing to note is that the actions are returning PartialViewResult.)

~/Controller/Content.cs

(Only important thing to note is that the action is returning PartialViewResult.)

~/Model/Entities.edmx

(Generated with Entity Framework Wizard.)


* Edit *

The @Html.Action(...) worked, but I would really like to know why the @Html.RenderAction(...) didn’t work. Any suggestions are welcome. 🙂

  • 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-23T13:54:51+00:00Added an answer on May 23, 2026 at 1:54 pm

    As an alternative, I would suggest trying to switch to:

    @Html.Action("actionMethod","controller")
    

    This extension helper works similarly to RenderAction, but returns MvcHtmlString, instead of writing directly to the Output buffer (Response stream).

    The Html.RenderAction is a method returns void. So you must put a “;” at the end. As for the exception, you might want to try to debug into it and see what the variables are set to etc if you would like to stick with that helper method.

    Hopefully that helps.

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

Sidebar

Related Questions

While working on ASP.NET MVC 2 web site I faced to the following problem.
Today I faced a strange problem in C#. I have an ASP.NET page where
I'm working on asp.net mvc web site Localization and I've faced problems with enums
I'm using Asp.NET MVC and have a huge dependency on JQuery throughout my entire
In my ASP.Net MVC application I am using IoC to facilitate unit testing. The
I faced a problem while using threading for the first time, In an SWT
I have an ASP.NET MVC Page that i have to display the fields in
I am looking at databases for a home project (ASP.NET MVC) which I might
I am working on a test application based on ASP.NET MVC. I am new
I have a basic ASP.Net MVC 3 application which has a number of controllers

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.