Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WebService Question
Message
De
18/03/2005 21:45:18
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
00997428
Message ID:
00997529
Vues:
12
Paul,

Hope Kevin doesn't mind me jumping in ...

Yes, since the method is static, and it's using that variable, it needs to have that variable available to it, so that's why it needs to be static as well.

Is there any reason that the method is static? I bet you can get rid of that.

~~Bonnie



>Hi Kevin,
>
>I actually had to add "static" back to the declaration. After removing "static" it seemed to work until I went to use the variable in another one of the methods of the class. The method is a static method is this the reason? Any other reasons for this?
>
>Thanks,
>Paul
>
>>Glad that worked.
>>
>>Without seeing the code, I can't guess why it would be static.
>>
>>The only time I use static is for static properties in a 'global' class. I'll set properties to a particular value at startup, and want to be able to read them in other parts of the app.
>>
>>Kevin
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform