Cheers thats really helpful. Seems liek none of the examples ou there
are really designed to explain how to do things for a total newbie. They
all seem to be about principles rather than practicality.
Anyway thanks again,
Brock Allen wrote:
The problem is that code in the <script runat=server> goes in the class
definition, so:
<script runat=server>
void foo() {}
</script>
becomes
class YourPage : Page {
void foo() {}
...
}
So when you put the using starements in there it becomes:
class YourPage : Page {
using System;
void foo() {}
...
}
Which is illegal. You need the <%@ Import %> directive instead at the
top of the page:
<%@ Import Namespace="System"%>
<%@ Import Namespace="System.Collections"%>
etc...
-Brock
DevelopMentor
http://staff.develop.com/ballen
Why in the hell am i getting this error?
Compiler Error Message: CS1519: Invalid token 'using' in class,
struct, or interface member declaration
Source Error:
Line 5: <script runat="server">
Line 6:
Line 7: using System;
Line 8: using System.Collections;
Line 9: using System.IO;
The code isnt really importanat but try as I might the "using" keyword
is causing an error, is this common am I being incredbly stupid? Does
anyone have a good example of a very basic c# asp.net pagI can play
with?
Never had this much hassle writing scripts in vbscript :)
Thanks in advance.
DC
"You can not reason a man out of a position he did not reach through
reason"
"Don't use a big word where a diminutive one will suffice."
"A man with a watch knows what time it is. A man with two watches is
never sure." Segal's Law
--
_______________________________________________
DC
"You can not reason a man out of a position he did not reach through reason"
"Don't use a big word where a diminutive one will suffice."
"A man with a watch knows what time it is. A man with two watches is
never sure." Segal's Law