Wrox Programmer Forums
|
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 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 13th, 2004, 11:16 AM
Registered User
 
Join Date: Jul 2004
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?

 
Old July 15th, 2004, 05:12 AM
Registered User
 
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.








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





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