Wrox Programmer Forums
|
BOOK: Beginning ASP.NET for Visual Studio 2015
This is the forum to discuss the Wrox book Beginning ASP.NET for Visual Studio 2015 by William Penberthy; ISBN: 978-1-119-07742-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET for Visual Studio 2015 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 27th, 2016, 04:30 PM
Registered User
 
Join Date: Feb 2016
Posts: 6
Thanks: 0
Thanked 2 Times in 2 Posts
Default Requesting Clarification for CH7 p218

Hi,

So on step 4 pf page 218's try it out, the book says to change the ViewStart.html to

Layout = "~/View/Shared/_MVCLayout.cshtml"; (original code in book has error where slash is not between View and Shared. Added it here)

When I do this, and then try to view the Manage page mentioned in the prior leadup step (Yes, I am changing manage to edit/5 seeing as we changed the page in the prior chapters), I get the below error. This also happens when I test the given example code in the same way




Server Error in '/' Application.

The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_MVCLayout.cshtml": "Scripts".

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_MVCLayout.cshtml": "Scripts".

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_MVCLayout.cshtml": "Scripts".]
System.Web.WebPages.WebPageBase.VerifyRenderedBody OrSections() +532
System.Web.WebPages.WebPageBase.PopContext() +182
System.Web.WebPages.WebPageBase.ExecutePageHierarc hy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +120
System.Web.WebPages.WebPageBase.ExecutePageHierarc hy(WebPageContext pageContext, TextWriter writer) +26
System.Web.WebPages.<>c__DisplayClass3.<RenderPage Core>b__2(TextWriter writer) +210
System.Web.WebPages.HelperResult.WriteTo(TextWrite r writer) +27
System.Web.WebPages.WebPageExecutingBase.WriteTo(T extWriter writer, HelperResult content) +31
System.Web.WebPages.WebPageBase.Write(HelperResult result) +32
System.Web.WebPages.WebPageBase.RenderSurrounding( String partialViewName, Action`1 body) +101
System.Web.WebPages.WebPageBase.PopContext() +146
System.Web.WebPages.WebPageBase.ExecutePageHierarc hy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +120
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +312
System.Web.Mvc.BuildManagerCompiledView.Render(Vie wContext viewContext, TextWriter writer) +115
System.Web.Mvc.ViewResultBase.ExecuteResult(Contro llerContext context) +248
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResult(ControllerContext controllerContext, ActionResult actionResult) +27
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +58
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +349
System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +69
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInv okeAction>b__1c() +188
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInv okeAction>b__1e(IAsyncResult asyncResult) +124
System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndD elegate(IAsyncResult asyncResult) +27
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncControllerActionInvoker. EndInvokeAction(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d( IAsyncResult asyncResult, ExecuteCoreState innerState) +27
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDel egate(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +21
System.Web.Mvc.Controller.EndExecuteCore(IAsyncRes ult asyncResult) +32
System.Web.Mvc.Controller.<BeginExecute>b__15(IAsy ncResult asyncResult, Controller controller) +26
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDel egate(IAsyncResult asyncResult) +40
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +21
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAs yncController.EndExecute(IAsyncResult asyncResult) +24
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__ 5(IAsyncResult asyncResult, ProcessRequestState innerState) +27
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDel egate(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End( ) +58
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +30
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsync Result asyncResult, Object tag) +21
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsync Result asyncResult) +29
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHan dler.EndProcessRequest(IAsyncResult result) +23
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute() +9742689
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +155
 
Old February 27th, 2016, 04:55 PM
Authorized User
 
Join Date: Jan 2016
Posts: 13
Thanks: 1
Thanked 1 Time in 1 Post
Default Ch7

Add the following code before the closing </body> tag in the _MVCLayout.cshtml file:

@RenderSection("scripts", required: false)
 
Old February 27th, 2016, 05:10 PM
Registered User
 
Join Date: Feb 2016
Posts: 6
Thanks: 0
Thanked 2 Times in 2 Posts
Default

That worked.

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
MasterPage requesting data... kov2013 BOOK: Beginning ASP.NET 4.5.1 : in C# and VB 3 March 11th, 2015 11:13 AM
Requesting Help Theapp1e Java Basics 7 May 7th, 2008 02:06 AM
Problems when requesting next page Vilariño Crystal Reports 1 June 19th, 2007 12:57 PM
Requesting PAGE name myself Classic ASP Basics 6 June 4th, 2006 08:23 AM
Problem in requesting certificate bhupi_josh BOOK: ASP.NET Website Programming Problem-Design-Solution 0 August 5th, 2005 02:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.