开发者

The type or namespace name 'function' could not be found?

开发者 https://www.devze.com 2022-12-21 10:18 出处:网络
I am writing a function proc in my C# 2008 ASP.Net application and I get the following error: The type or namespace name \'functio开发者_高级运维n\'

I am writing a function proc in my C# 2008 ASP.Net application and I get the following error:

The type or namespace name 'functio开发者_高级运维n' could not be found (are you missing a using directive or an assembly reference) ?

Any idea what this means?


If i understand you correctly, you have written something like this:

private function ValidateData() {}

If that is correct, then you need to change it to something like this:

private bool ValidateData() {}

where bool in this example, is your return type (boolean). If you have no return (then it is not a function). Here is what you would do then:

private void ValidateData() {}


"function" is a JavaScript keyword, not a C# keyword. Maybe the compiler thinks your JavaScript is meant to be C#.


private function ValidateData() { } 

you need to replace "function" with the return type of the function. In this case it would be void meaning that there is no return value.

private void ValidateData() { } 
0

精彩评论

暂无评论...
验证码 换一张
取 消