Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 July 20th, 2010, 12:26 PM
Registered User
 
Join Date: Jul 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 10, Page 334

I checked the errata and found no mention of this, i may be wrong but i had to insert the two 1's in this C# code, in the code behind of the Timer Demo. The book didnt mention this ;), if its just in there to test us, then sorry for bringing it up.


Chapter 10: ASP.NET AJAX
Page: 334

protected void Timer1_Tick(object sender, EventArgs e)
{
UpdateLabel1();
}

private void UpdateLabel1()
{
Label1.Text = System.DateTime.Now.ToString();
}

protected void Button1_Click(object sender, EventArgs e)
{
UpdateLabel1();
}
 
Old July 20th, 2010, 12:41 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Why would you need to add those 1's? You should remove them from the method signature instead, as they didn't have to be there in the first place. This is how the code from the book looks:

Code:
VB.NET Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles Timer1.Tick UpdateLabel() End Sub
Private Sub UpdateLabel() Label1.Text = DateTime.Now.ToString() End Sub
C# protected void Timer1_Tick(object sender, EventArgs e) { UpdateLabel(); }
private void UpdateLabel() { Label1.Text = System.DateTime.Now.ToString();
}
As you can see, the methods are called UpdateLabel, not UpdateLabel1.




Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 20th, 2010, 04:39 PM
Registered User
 
Join Date: Jul 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

argh i see, i placed a 1 in the method, and when i was getting errors it was pointing to the UpdateLabel. ive changed it now, ty.

Apologies
Saranjiv





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 11 Pg 334 Running Balance JackalBW BOOK: Access 2003 VBA Programmer's Reference 0 November 29th, 2007 04:07 AM
Errata - Chapter 10, Page 377, C# RobC BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 5 October 3rd, 2006 02:26 AM
Errata - Chapter 10, Page 378, C# RobC BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 August 31st, 2006 09:56 AM
Errata - Chapter 10, Page 376, C# RobC BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 August 31st, 2006 09:07 AM
Ex 10, Chapter 5, page 253 Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 1 June 16th, 2006 01:14 AM





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