I m working with MVC I m newbie in mvc.
when I m accessing an individual view then give an error: Additional information: Section not defined: "ContactUs".
HomeController:
- public class HomeController : Controller
- {
-
- public ActionResult Index()
- {
- return View();
- }
-
- public ActionResult ContactUs()
- {
- return View();
- }
-
- }
-
Index.cshtml
- @{
- ViewBag.Title = "Index";
- }
Index
- This is main body means Dynamic Content
layout.cshtml
-
-
-
- "utf-8" />
- "viewport" content="width=device-width, initial-scale=1.0">
- @ViewBag.Title - Template Editing
- "~/Content/Site.css" rel="stylesheet" type="text/css" />
- "~/Content/bootstrap.min.css" rel="stylesheet" type="text/css" />
- <!-- Inject Script Filtered -->
-
-
-
class
="container body-content"> -
-
Good Template
-
- @RenderBody()
- @RenderSection("ContactUs") //here get an error Additional information: Section not defined: "ContactUs".
-
-
2016@CopyRightsReserved
-
-
<!-- Inject Script Filtered --> <!-- Inject Script Filtered --> ContactUs.cshtml
- @{
- ViewBag.Title = "ContactUs";
- }
-
ContactUs
-
hello this is good guy Contact This Person
when I m accessing a contact.cshtml then error shown section is not defined??