Wiley.com
Print this page Share

Beginning ASP.NET 3.5: In C# and VB

ISBN: 978-0-470-18759-3
Paperback
768 pages
March 2008
Beginning ASP.NET 3.5: In C# and VB (047018759X) cover image
This title is out-of-print and not currently available for purchase from this site.

Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
XXVIII Error in Text
but look for a feature like User Folder Names

should be:

but look for a feature like Use Folder Names
07/15/2008
16 Error in Text
first paragraph:

reads: "At the top of the application, right below the Windows title bar..."

Should be: "At the top of the application, right below the window's title bar..."
2/25/11
24 Error in Text
Reads: Note that VWD automatically inserts the closing < h1 > for you.

It should read: Note that VWD automatically inserts the closing < /h1 > for you.
10/15/2010
2 33 Error in Text
Last list in the "...this chapter examines:", reads:

"How to use the designer tools to created formatted web pages"

should read:

"How to use the designer tools to create formatted web pages"
07/08/2008
41 Error in Table
Last item in the table, last column:

Contains design information for controls in your web site. Skins are discussed in the next chapter.

Should be

Contains design information for controls in your web site. Skins are discussed in Chapter 6.
03/05.09
43 Typo in Text
The last sentence on the page (item 5):

"... the CSS file will be added to you site."

Should be

"... the CSS file will be added to your site."
1/29/09
2 57 Error in Text
and not the entire table with four rows

Should be:

and not the entire table with three rows
07/15/2008
88 Error in Text
?blue?

should be:

?green?
07/15/2008
3 100 Typo in Text
"The heading must have a font size if 18 pixels"

should read:

"The heading must have a font size of 18 pixels"
12/30/08
4 120 Error in Code interpretation
step 6, 3rd shaded line the part that says: lstFavoriteLanguage Please note that the first character is a lower case L, not the number one. The code is correct as is with that character as a lower case L.
04/03/08
4 133 Error in Text
end of 2nd paragraph:
"which controls attribute to?

Should be:
"which controls contribute to"
09/22/08
5 141 Error in Code
Gray box near the top of the page, final line:

Dim i4 as Integer = CType(o2, Integer) 'Works, because 02 <i>looks</i> like an Integer

should be:

Dim i4 as Integer = CType(o2, Integer) 'Works, because o2 <i>looks</i> like an Integer
12/16/08
162 Error in Text
single sentence paragraph near the middle of the page:
The C# example doesn't extract 1 from the Length, though.

Should be:
The C# example doesn't subtract 1 from the Length, though.
09/07/08
5 165 Typo in Text
Below C# block:

...to what extend other web pages...

Should be:

...to what extent other web pages...
4/20/09
5 173 Error in Text
Public Partial Class Demos_Calculator

Should be

Partial Public Class Demos_Calculator
03/05/09
5 173, 177 Error in Code
The Calculator type on the left side of the assignment operator on the top of page 173 is missing the namespace prefix. Change this:

Calculator myCalculator = new Wrox.Samples.Calculator();

to this:

Wrox.Samples.Calculator = new Wrox.Samples.Calculator()
4/20/09
5 177 Error in Text
First C# example shows a space between my and Calculator which shouldn't be there. To fix it, change:

Calculator my Calculator = new Calculator();

to

Calculator myCalculator = new Calculator();
11/20/09
188 Error in Text
Top of the page:

The default is Private which hides the class by default.

should be:

The default is internal (Friend in VB.NET) which makes the class visible to other classes in the same assembly (a.DLL) but hides it from code outside the assembly)
06/12/2008
6 197 Error in Code
To match figure 6-2, the code for step 3, line 3:

<div id="Header"><a class="HeaderLink" href="~/" runat="server"></a></div>

should be:

<div id="Header"><a class="HeaderLink" href="~/" runat="server">Header Goes Here</a></div>
04/10/2008
6 202 Typo
first paragraph under Nested Master Pages, last sentence says:
for nested maser pages

should be:
for nested master pages
09/23/08
6 202 Error in Text
Last sentence of the second paragraph says that the content control will be empty, but that's not the case. Replace the text:

This will add an empty <asp:Content> control to the page that you can fill with your own content.

with the text:

This will copy the default contents into a new control which you can then modify.
5/27/09
206, 207 Error in Code
Chapter 6: Page 206 / 207 Note

The code on these pages checks the page's title for the text "Untitled Page" to make sure a page with this meaningless title never makes it to a production site. However, Service Pack 1 for Visual Web Developer 2008 (which was released after this book was published) has changed the default behavior. Pages now no longer have "Untitled Page" as their title, but an empty string instead. If you want the BasePage to check for empty strings as well, change the code on page 206 and 207 to this:

206 (VB)

If Me.Title = "Untitled Page" Or String.IsNullOrEmpty(Me.Title) Then
Throw New Exception("Page title cannot be ""Untitled Page"" or an empty string.") End If



207 (C#)

if (this.Title == "Untitled Page" || string.IsNullOrEmpty(this.Title)) {
throw new Exception("Page title cannot be \"Untitled Page\" or an empty string."); }



Notice the extra check for the empty title using the IsNullOrEmpty method on the String class.
2/6/09
6 212 Error in Text
Step 7 contains the text: "Type MyBasePage as the new page name." Instead of "new page name," this should have been "template name."
9/14/09
6 231 Error in Text
In the last paragraph

"Default.aspx"

Should be

"SkinDemo.aspx"
4/20/09
7 239 Error in Text
1st paragraph:

"been modified to refer to an image in the same document as"

should be

"been modified to refer to an image in the same folder as"
1/12/09
241 Error in Text
third sentence from the end:

"The Menu on the right displays Home only when the page first loads."
(This implies that Home is only displayed when the page first loads, but not later.)

should be:

"When the page first loads, the Menu on the right only displays Home."
06/13/2008
7 242 Error in Code
<siteMapNode url="~/ " title="Home" description="Go to the homepage" />

should be:

<siteMapNode url="~/ " title="Home" description="Go to the homepage">
1/12/09
7 244 Error in Text
Internet Explorer 8 and ASP.NET 3.5 don't play nice together when it comes to rendering the Menu control. When you view the menu in that browser, the sub menus are all blank and the menu text doesn't show up. The problem is caused by a change in the rendering engine of IE 8 to more strictly stick to the W3C web standards. You can fix the problem in two ways:

1. Add a high z-index to the .DynamicMenuStyle class (that you may need to add to your CSS file) first like this:

.DynamicMenuStyle
{
z-index: 1000;
}

2. Install a patch released by Microsoft.
http://weblogs.asp.net/bleroy/archive/2009/03/23/asp-menu-fix-for-ie8-problem-available.aspx

For more information, see these posts and articles:

http://p2p.wrox.com/book-beginning-asp-net-3-5-c-vb-book-isbn-978-0-470-18759-3/73512-ie8-menu.html

http://blogs.msdn.com/giorgio/archive/2009/02/01/asp-net-menu-and-ie8-rendering-white-issue.aspx
7/10/09
7 247 Error in Text
The first paragraph on the page talks about the <page> element in web.config, but this should be the <pages> element.
9/14/09
7 254 Error in Text
The line above Step #1 of Try It Out:

...write some code that either shows the Menu or the TreeView...

To be grammatically correct, it should read:

...write some code that shows either the Menu or the TreeView...
4/27/09
258 Typo
Second to last sentence of the last paragraph:
directly go the content

should be:
directly go to the content
09/10/08
8 271 Error in Step
first line of step #10:

...Wrap the Image in a standard element and set its src attribute...

should be:

...Wrap the Image in a standard
element and set its href attribute...
08/25/08
8 275 Error in Text
Chapter 8, page 275, section "How It Works," second paragraph, first sentence, first clause:

When you add the control registration to the master page

Should be:

When you add the control registration to the web.config file
06/24/2008
276 Error in Code
The code says to add code to the Page_Load event. However, that should be Page_Init to avoid problems in more advanced scenarios. So this code:

VB.NET
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) _
Handles Me.Load
Me.ID = "Master"

C#
protected void Page_Load(object sender, EventArgs e) {
this.ID = "Master";


should be:

VB.NET
Protected Sub Page_Init(ByVal sender As Object, ByVal e As
System.EventArgs) _
Handles Me.Init
Me.ID = "Master"

C#
protected void Page_Init(object sender, EventArgs e) {
this.ID = "Master";


For more info, please the following Blog post on the author's web site:
http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=469
09/11/08
299 Error in Text
Chapter 9, page 299, section "Extending the Contact Form," item #2, first sentence:

Save button

Should be:

Send button
06/26/2008
311 Error in Text
This allows you, for example, to create a MailAddress instance like this:

should be:

This allows you, for example, to create a MailMessage instance like this:
06/12/2008
10 325 Error in Text
How It Works section, second paragraph. The sentence:

The ScriptManager you placed in the master page....

Should read:

The ScriptManager you placed in "UpdatePanel.aspx"....
4/20/09
357 Error in Text
You should use the App_Data folder only for data that is used at server

should be

You should use the App_Data folder only for data that is used at the server
11/02/08
11 364 Error in Text
The second paragraph under the How It Works heading is referring to an incorrect step number. The text:

The query shown in step 9

Should be

The query shown in step 8
9/14/09
372 Error in Table
Page 372, the table with data types contains a row for the varchar/nvarchar datatype. The Description column for that row should be changed from:

=======================================
Used to store text with a variable length.
The nchar stores the data in Unicode format, which allows you to store data for many foreign languages.
=======================================

to

=======================================
Used to store text with a variable length.
The nvarchar stores the data in Unicode format, which allows you to store data for many foreign languages.
=======================================
07/09/2008
12 400 Error in Code
Top of page, in the highlighted box that shows, "Your final code should look like this:", the second to last line in the box:

ORDER BY [Name]

should be

ORDER BY [SortOrder]
12/16/08
12 410 Error in Code
Due to a change in Service Pack 1 of VWD (to support SQL Server 2008) some issues my arise in the Try It Out on page 410 (and other TIO's that use an SqlDataSource and a DateTime column). VWD incorrectly infers a Date data type instead of a DateTime. After step 6 on page 411 you may end up with the following code in the SqlDataSource:

<asp:Parameter DbType="Date" Name="UpdateDateTime" />

However, the correct DbType should be a DateTime instead of a Date:

<asp:Parameter DbType="DateTime" Name="UpdateDateTime" />

Without this change, you may receive the following error when you request the page:

"The version of SQL Server in use does not support datatype 'date'"
4/9/09
420 Error in Text
In the How It works section:

<asp:RequiredFieldValidator ID="RequiredFieldValidator2"
runat="server" ErrorMessage="Please enter a title."

But that should be:

<asp:RequiredFieldValidator ID="ReqVal2" runat="server"
ErrorMessage="Please enter a title."
11/6/09
12 423 Error in Text
Question 1 on page 423 asks you what control you should use to hook up the data control to the database. The explanation in Appendix A doesn't mention the SqlDataSource control that is needed (as you haven't seen LINQ at this stage) to hook up the control to the database.
4/20/09
430-remainder Error in Code
Error on 430 and through the remainder of the book: On non English versions of Visual Web Developer (VWD) or Visual Studio (VS) 2008 you may get unexpected results when working with the LINQ to SQL classes designer. The problem lies in the way the designer pluralizes tables names in the designer. For example, when you drag a table called Review on the designer, VWD / VS will automatically expose a Reviews property on the data context so you can access it like this:

VB.NET
Using myDataContext As New PlanetWroxDataContext() Dim allReviews = From review In myDataContext.Reviews _ Where review.Authorized = True _ Order By review.CreateDateTime Descending _ Select review End Using

C#
using (PlanetWroxDataContext myDataContext = new PlanetWroxDataContext()) { var allReviews = from review in myDataContext.Reviews where review.Authorized == true orderby review.CreateDateTime descending select review; }

Notice how the myDataContext property has a Reviews collection (plural) even though the original table was called Review in singular form. This only works on English versions of VWD / VS.

On other languages, the table won't be pluralized automatically. In that case, the PlanetWroxDataContext has a Review property. This means you'll need to adjust code examples as the one on page 430 to use the Review collection:

VB.NET
Using myDataContext As New PlanetWroxDataContext() Dim allReviews = From review In myDataContext.Review _ Where review.Authorized = True _ Order By review.CreateDateTime Descending _ Select review End Using

C#
using (PlanetWroxDataContext myDataContext = new PlanetWroxDataContext()) { var allReviews = from review in myDataContext.Review where review.Authorized == true orderby review.CreateDateTime descending select review; }

The same problem may be present in other LINQ to SQL code examples in the book.

Instead of adjusting the code, you could also rename the Review property in the code. You'll find the property in the PlanetWrox.designer.cs class:

public System.Data.Linq.Table Review { get { return this.GetTable(); } }
09/11/08
431 Error in Text
third paragraph, fourth line, fourth word:

"off"

should be:

"of"
06/27/2008
13 459 Error in Code
Code example at the top of the page: The definition for the Label button is followed by an empty element that shouldn't be there:

<asp:Label ID="TooltipLabel" runat="server" Text='<%# Eval("Tooltip") %>'
/>< />

Should be:

<asp:Label ID="TooltipLabel" runat="server" Text='<%# Eval

("Tooltip") %>' />

In addition, the definition for the Delete button has an extra double-quote.

<asp:Button ID="DeleteButton" runat="server" CommandName="Delete" " />

should be

<asp:Button ID="DeleteButton" runat="server" CommandName="Delete" />
9/14/09
13 464 Error in Text
Second paragraph of the How it Works section, 5 lines up from the bottom of the paragraph, the word "false" should be "true."

It says, "...you can set the Cancel property of the e argument that is passed to the event handler to False..." The "False" should be "True" because in the Try It Out section, the cancel property is set to "True."
1/12/09
14 489 Error in Text
First sentence of the last paragraph:

and asks for that control for its data.

should be:

and asks that control for its data.
9/14/09
14 491 Error in Text
In step 3 you get an instruction to add an Imports statement to the Code Behind if you are using Visual Basic. Changes to the latest Service Pack for Visual Web Developer (which was released after this book was published) now require a "using" statement as well if you are using C#. Step 3 on page 491 should therefore read:

3. At the top of the Code Behind of the document add the following line of code:

VB.NET
Imports System.Data

C#
using System.Data;

Adding "using System.Data;" brings this namespace in scope for the C# project as well so you get access to the DataRowView class.
4/27/09
14 493 Error in Text
On Top of Page:
GridView1_RowRowDataBound

should be:
GridView1_RowDataBound
09/29/08
14 509 Error in Code
Top of page, within the VB code, the last line of the VB code that says "this.Title,"

should be

"Me.Title."
1/12/09
15 528 Error in Text
last two sentences:

"... then press Ctrl+V to paste your LoginView,"

should be:

"... then press Ctrl+V to paste the Login control into your LoginView."
06/26/2008
529 Error in Text
section 5, second sentence:

"The LoginView should be placed inside the AnonymousTemplate..."

should be:

"The Login control should be placed inside the AnonymousTemplate..."
06/26/2008
550 Error in Text
second paragraph, second and third sentences:

"The run time then found the allow element that grants access to the Managers role and immediately lets you in. The final rule that blocks access to all other users is never even checked anymore."

should be:

"The runtime then found the allow element that grants access to the Managers role and immediately let you in. The final rule that blocks access to all other users was not even checked."
06/24/2008
15 552 Error in Text
In Service Pack 1 for Visual Web Developer (which was released after this book was published) the default templates for new Web Forms have changed and now contain fewer "using" statements for the C# web forms. This means you manually need to add some "using" statements to make some examples work.

In order for the Roles class to be available in the C# example in step 5 on page 552, you need to add a "using" statement for the System.Web.Security namespace. To do this, add the following to the top of the Code Behind file, before the class definition:

using System.Web.Security;

VB.NET imports this namespace by default so you don't need to add it when you're using that language.
7/10/09
558 Error in Text
"run time"

should be:

"runtime"
06/24/2008
16 559 Error in Table
The third row, second cell of the table refers to anonymousAuthentication which should be anonymousIdentification
9/14/09
561 Error in Text
"Chapter 5 discusses how to use generics to store role names using a generics list of strings."

should be:

"Chapter 5 discusses how to use generics to store role names using a generic list of strings."
06/24/2008
17 604 Error in Code
step 9: The code reads:
<h1>Un unknown error occurred</h1>

But should read:
<h1>An unknown error occurred</h1>
4/7/11
18 635, 636 Error in Text
In Service Pack 1 for Visual Web Developer (which was released after this book was published) the default templates for new Web Forms have changed and now contain fewer "using" statements for the C# web forms. This means you manually need to add some "using" statements to make some examples work.

In order for the ConfigurationManager class to be available in the C# example on page 635 / 636, you need to add a "using" statement for the System.Configuration namespace. To do this, add the following to the top of the AppConfiguration.cs file, before the class definition:

using System.Configuration;

VB.NET imports this namespace by default so you don't need to add it when you're using that language.
7/10/09
App A 674 Error in Code
There's no reason for </p> at the end of the User Control code. So this

<uc1:ContactForm ID="ContactForm1" runat="server"

PageDescription= "Contact Page" /></p>

Should be:

<uc1:ContactForm ID="ContactForm1" runat="server"

PageDescription= "Contact Page" />
9/14/09
678 Error in Excercise 3 Solution Code
Exercise 3 solution code is incorrect.

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "PictureDetails.aspx?Id=" + Eval("Id") %>'>

Should be:
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "PictureDetails.aspx?Id=" + Eval("Id").ToString() %>'>
09/08/08
Back to Top