Developer forum

Forum » Templates » Partial views
Denys Ubizskyy
Reply

Hi all,

I wonder if there is a way to use partial views with "Layouts & Design" approach and Razor in DW? 

Something like this:
@RenderPartial("_partialView.cshtml")

Thank you in advance.


Replies

 
Mikkel Ricky
Reply

You cannot use @RenderPartial in Dynamicweb Razor templates, but you can use @IncludeFile(string), e.g. @IncludeFile("Partials/Navigation.cshtml") to include another file in your template. All @IncludeFiles are expanded, i.e. replaced by the content of the included file, before Razor is processing the template.

Best regards,
Mikkel

 

You must be logged in to post in the forum