Stackoverflow Exceptions with Html.Action

Posted by: K. Scott Allen, on 09 Feb 2011 | View original | Bookmarked: 0 time(s)

If you ever have a stack overflow using Html.Action or Html.RenderAction in a Layout view, then check the return type of your child action. public class Weather : Controller { public ActionResult Forecast() { // ... return View(); } } The problem is if you call that action from a Layout view, like so: @Html.Action(actionName: "Forecast", controllerName: "Weather") ... then the child action is returning a ViewResult (which will pick up a Layout from...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: XML | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 505 | Hits: 23

Similar Posts

  • Using T4MVC strongly-typed helpers with Telerik Extensions for ASP.NET MVC more
  • Html Encoding Code Blocks With ASP.NET 4 more
  • WebAii Testing Framework: From HTML to XAML and Back -- RadHtmlPlaceholder more
  • How to use Ninject 2 with ASP.NET MVC more
  • How to create a DropDownList with ASP.NET MVC more
  • Url.Action() and RouteValue Encoding more
  • The ASP.NET MVC ActionController The controllerless action, or actionless controller more
  • An Alternative Approach To Strongly Typed Helpers more
  • ViewModel with MVC/Navigation in Silverlight more
  • Donut Hole Caching in ASP.NET MVC more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD