Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > calling 'GetLocalResourceObject' from a nested class

Reply
Thread Tools

calling 'GetLocalResourceObject' from a nested class

 
 
ANeelima
Guest
Posts: n/a
 
      12-03-2007
I am using C# and I created an .aspx page and the corresponding .aspx.cs code
behind file. In the code behind file I have the following class structure

public partial class myclass : page
{

private class nestedclass : myclass
{
public string getResourceString()
{

}
}
}

The nested class has a publi method which attempts to call
'GetLocalResourceObject' and passes in the resource key. When I call
'GetLocalResourceObject' from the nested class, it does not work and throws
me the following error:

"Object reference not set to an instance of an object."

But, when I call the method from the main class itself (myclass), it works
fine. So, how can I call localization methods from a nested class??

Thanks.
--
ANeelima
 
Reply With Quote
 
 
 
 
Random
Guest
Posts: n/a
 
      12-04-2007
I'm not sure if it will help with your problem, but I have come across
several people with issues when it comes to doing anything beyond the basic
with embedded resources. The following article (and code) helped me
understand the issues better, and resolved my problem at the time.

http://msdn2.microsoft.com/en-us/library/aa302284.aspx

"ANeelima" <> wrote in message
news:34AC5BA7-AE93-46DC-9110-...
>I am using C# and I created an .aspx page and the corresponding .aspx.cs
>code
> behind file. In the code behind file I have the following class structure
>
> public partial class myclass : page
> {
>
> private class nestedclass : myclass
> {
> public string getResourceString()
> {
>
> }
> }
> }
>
> The nested class has a publi method which attempts to call
> 'GetLocalResourceObject' and passes in the resource key. When I call
> 'GetLocalResourceObject' from the nested class, it does not work and
> throws
> me the following error:
>
> "Object reference not set to an instance of an object."
>
> But, when I call the method from the main class itself (myclass), it works
> fine. So, how can I call localization methods from a nested class??
>
> Thanks.
> --
> ANeelima



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling Ruby module methods from a nested class within mgerstenblatt@gmail.com Ruby 1 03-16-2011 02:36 PM
Nested friend class in nested template problem tonvandenheuvel@gmail.com C++ 3 12-07-2007 03:02 PM
calling non-static nested class Pradyut Java 3 02-06-2007 05:56 AM
Is nested class automatically friend of class that it is nested in? request@no_spam.com C++ 5 09-25-2006 08:31 AM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57