Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 12th, 2010, 12:56 AM
Registered User
 
Join Date: Jan 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default IDs can't start with a number

I have noticed that I cannot use a number in the beginning of an ID even though the book I am reading (Beginning ASP.NET 3.5) gives some example IDs in that format. Why is that?
  #2 (permalink)  
Old January 12th, 2010, 02:47 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

To use variables in your C# programs, you must know how to create variable names. In C#, variable names must adhere to the following rules:
  1. The name can contain letters, digits, and the underscore character (_).
  2. The first character of the name must be a letter. The underscore is also a legal first character, but its use is not recommended at the beginning of a name. An underscore is often used with special commands, and it's sometimes hard to read.
  3. Case matters (that is, upper- and lowercase letters). C# is case-sensitive; thus, the names count and Count refer to two different variables.
  4. C# keywords can't be used as variable names. Recall that a keyword is a word that is part of the C# language. (A complete list of the C# keywords can be found in Appendix B, "C# Keywords.")
Please check the following link on variables:
http://www.codeguru.com/csharp/sampl...le.php/c11387/
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.
  #3 (permalink)  
Old January 12th, 2010, 05:12 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi acr.repair,

Take a look at the errata for the book:

http://www.wrox.com/WileyCDA/WroxTit...Cd-ERRATA.html

You probably read lstFavoriteLanguage as firstFavoriteLanguage but is in fact listFavoriteLanguage. In other words, the first charcter is an lower case l as in List, not a 1 as in one or first.

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!
  #4 (permalink)  
Old January 12th, 2010, 02:18 PM
Registered User
 
Join Date: Jan 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default another example

You are probably correct about that one, however, in Beginning ASP.NET 3.5, what about chapter 5 page 158 where it ants me to use the ID
"1stOperator". Am I reading that one correctly?
  #5 (permalink)  
Old January 12th, 2010, 03:53 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

The book uses lst (with an l as in list) exclusively. I know for sure, as I wrote it ;-)

However, because of the font used for the text, it may *appear* as if it's written with a 1.

In my upcoming .NET 4 version of this book, I am no longer using this prefix to avoid this confusion, but use FavoriteLanguageList instead.

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!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ids dhoward VB.NET 2002/2003 Basics 4 December 17th, 2007 05:46 PM
Email IDs rohit_ghosh Excel VBA 2 July 16th, 2007 03:57 PM
Custom Generate IDs wackoyacky SQL Language 4 June 4th, 2007 08:53 AM
Dialog Help Ids sumeetpm Visual C++ 0 October 31st, 2006 03:19 PM
Assigning Record IDs dkspivey VB.NET 2002/2003 Basics 1 November 12th, 2004 12:39 PM



All times are GMT -4. The time now is 11:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.