Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Unrendered sections does not throw when redefined and rendered in nested layout. #2252

Closed
ajaybhargavb opened this issue Mar 24, 2015 · 1 comment
Assignees
Milestone

Comments

@ajaybhargavb
Copy link
Contributor

Follow up #2226
For sections that are redefined but not rendered in the outer definition.

// NestedLayout
@{ Layout = "OuterLayout"; }
@section scripts {
   // stuff
}

// OuterLayout
@{ Layout = "BaseLayout"; }
@section scripts { 
  // Don't render inner scripts
}

// BaseLayout
@RenderSection("scripts");

In this scenario, the scripts section defined by NestedLayout is never rendered but the view would happily succeed.

cc' @pranavkm

@pranavkm
Copy link
Contributor

I was already looking at a fix for this - should get a PR out for this in a bit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants