What is the difference between RenderSection and Web Helper

dr_m_6000

New Member
What is the difference between \[code\]RenderSection\[/code\], \[code\]RenderPage\[/code\] and a Web Helper?
  • List item I've used \[code\]RenderPage\[/code\], and it takes 2 parameters; the name of the file on disk, and an array of \[code\]object\[/code\]s to be passed to that page.
  • I've used \[code\]RenderSection\[/code\], which I believe only takes 1 parameter; the name of the \[code\]section\[/code\].
  • I've also used Web Helpers. This is where I get confused. With Helpers, you can pretty much so everything you can do with \[code\]RenderBody\[/code\], and \[code\]RenderSection\[/code\].
Here's where I get confused:Sections file:\[code\]@section footer { <p>Copyright 2012 blah. Most rights reserved.</p>}\[/code\]Helper file:\[code\]@helper header { <p>Copyright 2012 blah. Most rights reserved.</p>}\[/code\]CSHTML File:\[code\]...<body> @MyHelpers.header() @RenderBody() @RenderSection("footer", required: true)</body>...\[/code\]
 
Back
Top