Monday, June 3, 2013

The Layout Rendering Life Cycle in Razor ....


<!DOCTYPE html>
        <html lang="en">
            <head>
                 <meta charset="utf-8" />
                 <title>@View.Title</title>
           </head>
        <body>
                  <div class="header">
                      @RenderSection("Header")
                 </div>
                        @RenderBody()
                <div class="footer">
                      @RenderSection("Footer")
                </div>
       </body>
       </html>

for above sample razor page life cycle event shown in below

1. _Layout.cshtml
2. The Header section in Post.cshtml
3. _Layout.cshtml
4. The body of Post.cshtml
5. _Layout.cshtml
6. The Footer section in Post.cshtml
7. _Layout.cshtml

No comments:

Post a Comment