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?
|