Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > using an object control from another control

Reply
Thread Tools

using an object control from another control

 
 
oterox
Guest
Posts: n/a
 
      11-04-2003
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("fo rm1.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???




 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      11-05-2003
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" <(E-Mail Removed)_NOSPAM> wrote in message
news:(E-Mail Removed)...
> 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("fo rm1.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???
>
>
>
>



 
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
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
How to force a load of one control from another control on another form? et ASP .Net 1 06-29-2005 07:45 PM
How to force a load of one control from another control on another form? et ASP .Net Datagrid Control 0 06-29-2005 06:05 PM
Creating object of another object Maziar Aflatoun ASP .Net 1 04-06-2005 02:25 PM
Access a control inside an usercontrol from another control inside another usercontrol nail ASP .Net 0 09-15-2004 03:55 PM



Advertisments