Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial view #15848

Closed
FIVIL opened this issue Jul 2, 2018 · 2 comments
Closed

Partial view #15848

FIVIL opened this issue Jul 2, 2018 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@FIVIL
Copy link

FIVIL commented Jul 2, 2018

Hi, is it possible to use razor partial views in blazor??

@lohithgn
Copy link

lohithgn commented Jul 2, 2018

isnt creating a component and using it - in a way partial view ?? You can create any cshtml in your project or app and just use it any where you want like a component.

for example , lets say i create a greeter component like below

components/Greeter.cshtml

<span>Hello $UserName</span>
@function{
[Parameter] string UserName {get;set'}
}

i can use greeter in lets say my Index.cshtml like below

Index.cshtml

@page "/"
<h1>Index</h1>
<Greeter UserName="Lohith" />

can you elaborate on your need for a partial ... In Blazor world everything is a component.

@SteveSandersonMS
Copy link
Member

Thanks for answering, @lohithgn. Yes, components satisfy this use case.

@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/blazor Oct 27, 2019
@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Oct 27, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

4 participants