Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 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 Display Modes
  #1 (permalink)  
Old July 13th, 2004, 11:16 AM
Registered User
Join Date: Jul 2004
Location: Surrey, BC, Canada.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Sarah-WCHM
Default Chapter 5 Error

In the "Functions" exercise, I am getting the following error:

Compiler Error Message: CS0119: 'ASP.Functions_aspx.BlankString(string)' denotes a 'method' which is not valid in the given context

Source Error:

Line 32: for (int i=1; i <= String1.Length; i++)
Line 33: {
Line 34: BlankString += "*";
Line 35: }
Line 36: return BlankString;

Source File: C:\BegASPNET11\Ch05\Functions.aspx Line: 34

My code (which is identical to the code in the complete code download) is:

string BlankString(string String1)
             string Blankstring = "";
             for (int i=1; i <= String1.Length; i++)
                 BlankString += "*";
             return BlankString;

Any suggestions on why I'm getting that error?

Reply With Quote
  #2 (permalink)  
Old July 15th, 2004, 05:12 AM
Registered User
Join Date: Jul 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Where you instantiate your String in line 3 of your code you use Blankstring and not BlankString, i.e you use little "s" and not capital "S".
so should be

string BlankString = "";

Hope this helps.

Reply With Quote

Thread Tools
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
error with chapter 7 busteronline BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 15 August 21st, 2008 03:22 PM
error with chapter 7 jdz66 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 August 21st, 2006 05:19 PM
Parse error in error handler (Chapter 8) Funky Monk BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 August 6th, 2004 08:59 AM

All times are GMT -4. The time now is 11:46 AM.

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