I have A difficulty in Code-First in task asp.net mvc when i Click Create activity or Click Edit activity the Error message Is


You are watching: The following sections have been defined but have not been rendered for the layout page

"InvalidOperationException: The complying with sections have actually been defined however have no been calculation by the page at '/Views/Shared/_Layout.cshtml': 'Scripts'. To ignore an unrendered section speak to IgnoreSection("sectionName")."but all activity working well and my renderbody(); is composed in mine layoutWhat I have actually tried:my password
public class NewsController : Controller{ private readonly NewsContext _context; public NewsController(NewsContext context) _context = context; // GET: News publicly async job Index() return View(await _context.News.ToListAsync()); // GET: News/Details/5 public async task Details(int? id) if (id == null) return NotFound(); var news = await _context.News .FirstOrDefaultAsync(m => m.NewsId == id); if (news == null) return NotFound(); return View(news); // GET: News/Create windy IActionResult Create() return View(); // POST: News/Create // To defend from overposting attacks, enable the specific properties you want to tie to, for // more details, check out http://go.microsoft.com/fwlink/?LinkId=317598. windy async task Create( News news) if (ModelState.IsValid) _context.Add(news); await _context.SaveChangesAsync(); return RedirectToAction(nameof(Index)); return View(news); // GET: News/Edit/5 windy async task Edit(int? id) if (id == null) return NotFound(); var news = await _context.News.FindAsync(id); if (news == null) return NotFound(); return View(news); // POST: News/Edit/5 // To defend from overposting attacks, permit the specific properties you desire to tie to, for // more details, check out http://go.microsoft.com/fwlink/?LinkId=317598. publicly async task Edit(int id, News news) if (id != news.NewsId) return NotFound(); if (ModelState.IsValid) shot _context.Update(news); await _context.SaveChangesAsync(); capture (DbUpdateConcurrencyException) if (!NewsExists(news.NewsId)) return NotFound(); rather throw; return RedirectToAction(nameof(Index)); return View(news); my View
HTML
Copy Code
model NewsApp.Models.News


See more: All Of The Elements Heavier Than Oxygen Are Created By Fusion Reactions In _____.

ViewData<"Title"> = "Create"; Layout = "~/Views/Shared/_Layout.cshtml";h1>Create/h1>h4>News/h4>hr>div class="row"> div class="col-md-4"> div class="text-danger">/div> div class="form-group"> expectancy class="text-danger">/span> /div> div class="form-group"> expectancy class="text-danger">/span> /div> div class="form-group"> expectancy class="text-danger">/span> /div> div class="form-group"> expectations class="text-danger">/span> /div> div class="form-group"> expectancy class="text-danger">/span> /div> div class="form-group"> /div> /div>/div>div> a>Back come List/a>/div>