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

ViewComponents should respect the global @inherits declaration in _ViewImports #3121

Closed
muratcakir opened this issue Sep 11, 2015 · 7 comments
Assignees
Milestone

Comments

@muratcakir
Copy link

At the moment this declaration does not seem to be applied to a ViewComponent

@Eilon
Copy link
Member

Eilon commented Sep 11, 2015

@dougbu @pranavkm do you know if this is deliberate? This sounds like a bug to me.

@pranavkm
Copy link
Contributor

It's not deliberate - they're treated as any other partial.

@dougbu
Copy link
Member

dougbu commented Sep 11, 2015

On first glance, a view invoked from ViewComponent.View() should respect _ViewImports.cshtml. However we probably didn't implement this because view component views do not and (probably, think we have an issue open on this) should not respect _Layout.cshtml. Respecting _ViewImports.cshtml would introduce a new case where some of that file would be ignored or cause errors.

@Eilon
Copy link
Member

Eilon commented Sep 11, 2015

But _ViewImports is different from _ViewStart. I agree they shouldn't run _ViewStart.

@rynowak
Copy link
Member

rynowak commented Sep 11, 2015

Agree with @Eilon - all of this work was done before we had the separation. This needs to be updated.

@Eilon Eilon added this to the 6.0.0-beta8 milestone Sep 11, 2015
@Eilon Eilon assigned pranavkm and ajaybhargavb and unassigned pranavkm Sep 11, 2015
@ajaybhargavb
Copy link
Contributor

This seems to work fine for ViewComponents without the @model declaration. This issue could be related to #3144.

@ajaybhargavb
Copy link
Contributor

Tracked by #3144. Closing this.

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

6 participants