If you are developing Razor Pages for Asp.Net core application, you may run into following compile time error.
Error CS0103 The name 'RenderBody' does not exist in the current contextRenderBody directive can only be used from a layout page. This directive is used to render page content. Layout is not a page. It is container of the page.
Above error will be raised when you will include @RenderBody directive on a page with @page directive at the top. By adding @page you have directed Asp.Net core that it is a page and not layout. Therefor compiler does not expect RenderBody to be included on the page.
To fix this error, remove @page directive from layout.
The name RenderBody does not exist in the current context
Resolve type or namespace name IWebHostEnvironment could not be found
How to plan CCSP Exam preparation
Develop a MongoDB pipeline to transform data into time buckets
Alert and Confirm pop up using BootBox in AngularJS
AngularJS Grouped Bar Chart and Line Chart using D3
How to lock and unlock account in Asp.Net Identity provider
2023 © Byteblocks, ALL Rights Reserved. Privacy Policy | Terms of Use