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

Conversation

@pranavkm
Copy link
Contributor

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible to bail out before rendering or is that required to populate _page.SectionWriters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The population of the section writers happens as part of the execution of the page. We could pass in the flag into the IRazorPage and have it throw when you call DefineSection, but it seems like mixing view behavior (full or partial) with page behavior which felt dirty.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems fine then. Is there a way for a RazorPage to know whether or not it's a partial?

For our scenarios this seems rather cut and dry. Wondering about 3rd party view engines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There isn't as yet. We could always pass something in - maybe as part of the ViewContext or make it a first class property of IView. The latter might not be a bad idea given that the notion partial and full views exists in the IViewEngine

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not a bad idea to know the rendering mode, lets file an issue (low pri IMHO, but we will get to it eventually)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way to optionally define section?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, but there's a way to optionally render it if it's defined RenderSection("foo", required: false)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking bug for this #1002

@rynowak
Copy link
Member

rynowak commented Aug 14, 2014

:shipit:

@pranavkm
Copy link
Contributor Author

Follow up item #1006 based on suggestions by @javiercn

@pranavkm pranavkm closed this Aug 14, 2014
@pranavkm pranavkm deleted the 79 branch August 14, 2014 19:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants