Errata

Programming Razor

Errata for Programming Razor

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page iv
"Revision history..."

First release is dated as "2001-09-28" - should be 2011?

Anonymous  Dec 07, 2011 
Printed Page xii
"Conventions used in this book", 3rd and 4th items

The sub-headers, "Constant width bold" and "Constant width italic," have been printed as strange square symbols instead of readable characters (compared to online version on Google Books http://books.google.com/books?id=2l-GvnvR9AIC&lpg=PP1&pg=PR12#v=onepage&q&f=false).

Anonymous  Dec 07, 2011 
PDF Page 5
First line of text at top of page (template...)

I believe the line should read:
"template @ { } wrapped characters...."
However, the line appears with the "@ { }" superimposed over the words "wrapped characters" with a space held for the correct placement of the "@ { }".

When I cut and paste from the PDF file, I get the following:
"template wr@a{p p} ecdh ainra cters."

Mark Schaffer  Sep 01, 2012 
PDF Page 5
First line of text at top of page (template...)

I believe the line should read:
"template @ { } wrapped characters...."
However, the line appears with the "@ { }" superimposed over the words "wrapped characters" with a space held for the correct placement of the "@ { }".

When I cut and paste from the PDF file, I get the following:
"template wr@a{p p} ecdh ainra cters."

mschaffer  Sep 01, 2012 
PDF Page 15
figure 2-4

In figure 2-4, the table for the posts is defined. The reader is instructed to make all of the fields to not allow nulls. Then, In the following sections describing the AddPost form, the POST action does not update the date field, so an error is encountered when trying to POST: PublicationDate is null.

In a related matter, the reader is not instructed to mark the ID field "IsIdentity". Some versions of SQL Express need this to be marked as the table is created because it cannot be altered afterwards.

Mark Schaffer  Sep 01, 2012 
PDF Page 19
code within listing on page inside if(IsPost){...}

Since the book was published in Sept. 2011, I assume that the author was using the original WebMatrix, however, in the latter part of 2011 and recently in 2012, WebMatrix 2 beta and WebMatrix 2 RC, respectively, have been released. These versions of WebMatrix require that a reference to a .dll or a library be added. This is most easily accomplished by using NuGet to add "Microsoft ASP.NET Web Pages 2 Web Data" to the project. Otherwise, the code presented on page 19 will not work as expected.

mschaffer  Sep 01, 2012 
Printed Page 21
row 10

var id=Request["id"].IsInt(-1);
SHOULD BE

var id=Request["id"].AsInt(-1);

Kurt Andersson  Mar 06, 2012 
PDF Page 23
11^line

If no errors occurred, the ModelState.IsValid property will reflect this by returning false.

The right is:
If no errors occurred, the ModelState.IsValid property will reflect this by returning true.

Scippy  Jan 07, 2016 
PDF Page 37
Ebook version, From bottom up, Line 12

Chage:

@foreach(var in posts) {
var url = "http://www.myblog.com/posts/post.cshtml"id=" + post.ID;
<div>
<h3>@post.Title</h3>
<div>@post.Body</div>
@TwitterHelpers.TweetButton( url: url, text: @post.Title )
@Facebook.LikeButton( href: url )
</div>
}


by:

@{
var post = Page.Post;
var url = "http://www.myblog.com/posts/post.cshtml?id=" + post.ID;
}

<div>
<h3>@post.Title</h3>
<div>@post.Body</div>
@TwitterHelpers.TweetButton( url: url, text: @post.Title )
@Facebook.LikeButton( href: url )
</div>

&#272;&#7895; Nh&#432; V?  Jul 31, 2013 
PDF Page 53
@foreach(var in posts)

@foreach(var in posts) {

change to this :

@foreach(var post in posts) {

ramin rajabi  Oct 27, 2013 
PDF Page 54
var url = "http://www.myblog.com/posts/post.cshtml"id=" + post.ID;

var url = "http://www.myblog.com/posts/post.cshtml"id=" + post.ID;

change to :

var url = "http://www.myblog.com/posts/post.cshtml&id=" + post.ID;

ramin rajabi  Oct 27, 2013