Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reference to a non-shared member
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00794619
Message ID:
00794956
Vues:
10
Hi Loy,

I now see how you have a nested class. I didn't see that originally.

A field in a class is not automatically available to a nested class. To be available to a nested class, the field must be static. Otherwise, you must create an instance of the outer class.

I'm not sure that you really wanted to create a nested class. Any time you define a class inside another class, it is a nested class. It doesn't have access to public members of the outer class because the outer class may or may not be instantiated, hence the necessity of the static member of the outer class. In this case, you have nested it inside a "Page" class, as you are using Response.Write().

Instead, you need to create the class OUTSIDE of the Page class. If you do so, you will want to get the Response object from the current HttpContext:
System.Web.HttpContext.Current.Response.Write(msg);
>Hi Cathi,
> Thanks for replying, but with or without "()" still has the error. I don't know why this won't work within a child class. There's something I need to add in this code to work.
>
>Loy
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform