calling 'GetLocalResourceObject' from a nested class

Discussion in 'ASP .Net' started by ANeelima, Dec 3, 2007.

  1. ANeelima

    ANeelima Guest

    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
     
    ANeelima, Dec 3, 2007
    #1
    1. Advertising

  2. ANeelima

    Random Guest

    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:...
    >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
     
    Random, Dec 4, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. E11
    Replies:
    1
    Views:
    4,842
    Thomas Weidenfeller
    Oct 12, 2005
  2. John Baima

    GetLocalResourceObject in Master Page

    John Baima, Aug 26, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    4,036
    John Baima
    Aug 28, 2006
  3. Pradyut

    calling non-static nested class

    Pradyut, Feb 5, 2007, in forum: Java
    Replies:
    3
    Views:
    403
  4. request@no_spam.com
    Replies:
    5
    Views:
    444
  5. Replies:
    3
    Views:
    480
    Victor Bazarov
    Dec 7, 2007
Loading...

Share This Page