using an object control from another control

Discussion in 'ASP .Net' started by oterox, Nov 4, 2003.

  1. oterox

    oterox Guest

    I have an aspx file with 3 user controls:Header,menu and footer.
    In the header i have this:
    ----------------------------------------------------------
    Dim rm1 As ResourceManager =
    ResourceManager.CreateFileBasedResourceManager("form1.EN",
    "C:\Inetpub\wwwroot\Web\test", Nothing)
    lblHeader.Text = rm1.GetString("greeting")
    ----------------------------------------------------------------

    Must i do the same in every user control???


    If i declare rm1 in the header, can i use it in the footer whitout
    re-declaring it again like this: rm1.getstring("")

    Should i declare rm1 in each user control???
     
    oterox, Nov 4, 2003
    #1
    1. Advertising

  2. A User Control is a class. If you declare "rm1" as a public property of the
    Header class, you can access it from any other class.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Big Things are made up of
    Lots of Little Things.

    "oterox" <_NOSPAM> wrote in message
    news:...
    > I have an aspx file with 3 user controls:Header,menu and footer.
    > In the header i have this:
    > ----------------------------------------------------------
    > Dim rm1 As ResourceManager =
    > ResourceManager.CreateFileBasedResourceManager("form1.EN",
    > "C:\Inetpub\wwwroot\Web\test", Nothing)
    > lblHeader.Text = rm1.GetString("greeting")
    > ----------------------------------------------------------------
    >
    > Must i do the same in every user control???
    >
    >
    > If i declare rm1 in the header, can i use it in the footer whitout
    > re-declaring it again like this: rm1.getstring("")
    >
    > Should i declare rm1 in each user control???
    >
    >
    >
    >
     
    Kevin Spencer, Nov 5, 2003
    #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. nail
    Replies:
    0
    Views:
    1,569
  2. Maziar Aflatoun

    Creating object of another object

    Maziar Aflatoun, Apr 6, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    316
    Kevin Spencer
    Apr 6, 2005
  3. et
    Replies:
    1
    Views:
    538
    Yunus Emre ALPĂ–ZEN [MCSD.NET]
    Jun 29, 2005
  4. Replies:
    7
    Views:
    613
    Jacques-Olivier Haenni
    Mar 13, 2006
  5. et
    Replies:
    0
    Views:
    154
Loading...

Share This Page