Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Getting a property of a control inside a usercontrol, from another usercontrol

Reply
Thread Tools

Getting a property of a control inside a usercontrol, from another usercontrol

 
 
Fabiano
Guest
Posts: n/a
 
      06-03-2005
Please,

i have a ASPX that contains two usercontrols, TOP.ASCX and CENTER.ASCX. The
first one has a dropdown list inside of it and the second one has a
Datalist.
When user changes the SelectedItem from the dropdown i need to change the
databind from my Datalist.

My doubt are. How can i read from inside the CENTER.ASCX, the dropdown
values from TOP.ASCX? I think that OOP don't let me do that, 'cause of
encapsulation. It's right?

At my fashion i'm using a session at the ASPX, something like this:
Session["CodigoProdutora"] =
(Page.FindControl("Topo1").FindControl("cboProduto ra") as
DropDownList).SelectedValue;

But i guess that there's another pretty way that i do the samething without
use Sessions. There's?

Thks if you folks could send me some help.

Fabiano


 
Reply With Quote
 
 
 
 
Kha Tran
Guest
Posts: n/a
 
      06-03-2005
- create a event EVENT (when dropdownlist changes value) in usercontrol
TOP.ascx.
- In the page containning instance ITOP (TOP.ascx) and ICENTER
(CENTER.ascx),
get a event Event of ITOP and write codes to control ICENTER.

On Fri, 03 Jun 2005 14:42:08 +0700, Fabiano <(E-Mail Removed)> wrote:
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
 
Reply With Quote
 
 
 
 
=?Utf-8?B?c3Jpbmk=?=
Guest
Posts: n/a
 
      06-03-2005
just a thought,
you can consider storing the selected value in a hidden field using
javascript and later use the value in the hidden field for any manipulation.
--
The best
srini
http://www.expertszone.com


"Fabiano" wrote:

> Please,
>
> i have a ASPX that contains two usercontrols, TOP.ASCX and CENTER.ASCX. The
> first one has a dropdown list inside of it and the second one has a
> Datalist.
> When user changes the SelectedItem from the dropdown i need to change the
> databind from my Datalist.
>
> My doubt are. How can i read from inside the CENTER.ASCX, the dropdown
> values from TOP.ASCX? I think that OOP don't let me do that, 'cause of
> encapsulation. It's right?
>
> At my fashion i'm using a session at the ASPX, something like this:
> Session["CodigoProdutora"] =
> (Page.FindControl("Topo1").FindControl("cboProduto ra") as
> DropDownList).SelectedValue;
>
> But i guess that there's another pretty way that i do the samething without
> use Sessions. There's?
>
> Thks if you folks could send me some help.
>
> Fabiano
>
>
>

 
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
usercontrol inside usercontrol Spartaco ASP .Net 0 07-31-2007 09:15 AM
setting a usercontrol property as another control kferron ASP .Net 1 11-15-2006 06:04 AM
Accessing USER CONTROL which is inside Masterpagethrough Another USER Control inside normal page. Kiran More ASP .Net Web Controls 2 11-14-2006 12:58 PM
Access a control inside an usercontrol from another control inside another usercontrol nail ASP .Net 0 09-15-2004 03:55 PM
Can we use a usercontrol inside a usercontrol Rajesh Tiwari ASP .Net 0 08-12-2003 03:56 PM



Advertisments