Deal of the Day

Home » Main » Manning Forums » 2011 » ASP.NET MVC 4 in Action, Third Edition

Thread: Section 3.2.1 - Where's the view code?

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Pages: 1 - Last Post: Sep 3, 2012 4:00 PM by: ytosa
dev007

Posts: 5
From: Canada
Registered: 3/14/12
Section 3.2.1 - Where's the view code?
Posted: Mar 15, 2012 1:10 AM
  Click to reply to this thread Reply

In section 3.2.1 there's a discussion about checking the current logged-in user to determine if he/she can edit a guestbook entry. They show the code for the Show controller action (listing 3.1) but they only show a fragment of the markup for the view (listing 3.2). Then they show the completed page in Figure 3.1. Up until now they have showed all the HTML code for the views. I was able to participate step by step until now. Looking ahead I see that they have included the required listing in listing 3.5 but that's after more discussion and more code additions to the example. Not a deal breaker but inconsistent with the current instructional style of book. I'm wasting time rereading the section to see if I have missed anything.

Dev@hamburg

Posts: 4
Registered: 8/21/11
Re: Section 3.2.1 - Where's the view code?
Posted: Apr 29, 2012 9:02 AM   in response to: dev007 in response to: dev007
  Click to reply to this thread Reply

Had the same difficulties.

ytosa

Posts: 7
From: Arlington, MA
Registered: 1/29/10
Re: Section 3.2.1 - Where's the view code?
Posted: Sep 3, 2012 4:00 PM   in response to: dev007 in response to: dev007
  Click to reply to this thread Reply

The book is very obscure what reader should do.

You add Listing 3.1 to GuestbookController and you create Show.cshml whose code is shown in Listing 3.5 (you have to remove the section for hasPermission, since we have not build Edit Control). In order to get Figure 3.1, you use the address of Guesbook/Show/1. Note that 1 is the id passed to Show controller.

Legend
Gold: 300 + pts
Silver: 100 - 299 pts
Bronze: 25 - 99 pts
Manning Author
Manning Staff
Manning Developmental Editor