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
- {
- // GET: Home
- public ActionResult Index() //main content
- {
- return View();
- }
- public ActionResult ContactUs()
- {
- return View();
- }
- }
- @{
- ViewBag.Title = "Index";
- }
Index
- This is main body means Dynamic Content
- "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" />
- class="container body-content">
-
-
Good Template
- @RenderBody()
- @RenderSection("ContactUs") //here get an error Additional information: Section not defined: "ContactUs".
-
2016@CopyRightsReserved
- @{
- ViewBag.Title = "ContactUs";
- }
ContactUs
hello this is good guy Contact This Person
Ashutosh GuptaPosted Dec 23, 2019, 12:01 PM
header
Rajeesh MenothPosted Dec 23, 2019, 11:58 AM
Rahul PatilPosted Dec 23, 2019, 7:37 AM
@Rajeesh Menoth when I m creating another individual view for ex: header then again give an error
2016@CopyRightsReserved
Header
hello Header
Rajeesh MenothPosted Dec 23, 2019, 7:11 AM