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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:56:11+00:00 2026-06-18T01:56:11+00:00

I am converting a WebForms application to Razor and everything works fine except when

  • 0

I am converting a WebForms application to Razor and everything works fine except when I try to use Html.RenderAction. Whenever I call this, I get a StackOverflowException. Does anyone have an idea on what might be causing this?

The template for my action looks like this:

@model dynamic   

should be rendering this

In my _Layout.cshtml file I render the action like this:

@{Html.RenderAction("MyPartialAction");}

My _ViewStart.cshtml file looks as follows:

@{
    this.Layout = "~/Views/Shared/_Layout.cshtml";
}
  • 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-18T01:56:12+00:00Added an answer on June 18, 2026 at 1:56 am

    The problem is that your template for your action does not define a Layout to be used. Therefore, it automatically gets the one specified in the _ViewStart.cshtml file. This will in effect cause the _Layout.cshtml file to be nested within itself ad infinitum. Hence the StackOverflowException. The solution is simple. Set the Layout within your action template to null:

    @model dynamic
    @{
       Layout = null;
    }
    should be rendering this
    

    Now the template won’t request to be embedded in a layout file and everything works fine.

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

Sidebar

Related Questions

I am converting an old ASP.NET WebForms app to ASP.NET MVC 4. Everything is
I'm in the process of converting parts of an application to use ASP.NET MVC
I am currently working on converting an existing webforms application to MVC and am
I have a web application that began using WebForms. We've been steadily converting each
I am converting an application I created using webforms to the asp.net mvc framework
I'm trying to teach myself MVC3. Im converting from webforms. I need to create
I'm converting a legacy webforms app to MVC, working through it a page at
I'm converting an app from ASP.NET WebForms to WinForms. There is one asp.net page
Has anybody gone through the process of converting a real-world business application from ASP.NET
When converting PSD's into HTML or even HTML5 and CSS, how much more difficult

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.