I have create a partial view and try to add it to a content page. But it just show a code inside the content page. How should I do to add my partial view to the content page?
Please read my question again. I just want to show my partial view inside login page which created from Content pane. The Login page created under Home page with type of "Landing Page".
Because of Landing Page doesn't allow to enter c# tag like @Html, so I cannot include my partial view into the Landing Page. That why I ask you to help me to find a way to include my partial view into contain page.
If you want to add the partial view to a page using the backoffice, and not directly in to a template, then you can add the partial view in a rich text editor.
How to add a partial view to content page?
Hello,
I have create a partial view and try to add it to a content page. But it just show a code inside the content page. How should I do to add my partial view to the content page?
Hi Nguyen, You can just call your partial view as
If you want to pass model to partial view,
Hi Sabin,
Please read my question again. I just want to show my partial view inside login page which created from Content pane. The Login page created under Home page with type of "Landing Page".
Because of Landing Page doesn't allow to enter c# tag like @Html, so I cannot include my partial view into the Landing Page. That why I ask you to help me to find a way to include my partial view into contain page.
Hi Nguyen,
If you want to add the partial view to a page using the backoffice, and not directly in to a template, then you can add the partial view in a rich text editor.
But to be able to do this you need to use a Partial macro file https://our.umbraco.org/documentation/reference/templating/macros/partial-view-macros/ which are located under the developer section.
If you dont have the insert macro on the rich text editor
If you donĀ“t see the option right now then you can configure which option that should be possible in the rich text editor.
Since you are using the grid layout, then you also have the possibility to add a macro into the grid.
Try to see this documentation https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/Grid-Layout/grid-editors
What you just need to ensure is that the macro are allow to be insert into the grid or the rich text editor.
Hope this helps,
/Dennis
is working on a reply...