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

Discussion in 'ASP .Net' started by Fabiano, Jun 3, 2005.

  1. Fabiano

    Fabiano Guest

    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("cboProdutora") 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
     
    Fabiano, Jun 3, 2005
    #1
    1. Advertising

  2. Fabiano

    Kha Tran Guest

    - 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 <> wrote:
    --
    Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
     
    Kha Tran, Jun 3, 2005
    #2
    1. Advertising

  3. RE: Getting a property of a control inside a usercontrol, from another

    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("cboProdutora") 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
    >
    >
    >
     
    =?Utf-8?B?c3Jpbmk=?=, Jun 3, 2005
    #3
    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. Rajesh Tiwari

    Can we use a usercontrol inside a usercontrol

    Rajesh Tiwari, Aug 12, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    437
    Rajesh Tiwari
    Aug 12, 2003
  2. nail
    Replies:
    0
    Views:
    1,567
  3. kferron
    Replies:
    1
    Views:
    308
    kferron
    Nov 15, 2006
  4. Spartaco

    usercontrol inside usercontrol

    Spartaco, Jul 31, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    624
    Spartaco
    Jul 31, 2007
  5. Kiran More
    Replies:
    2
    Views:
    334
    Kiran More
    Nov 14, 2006
Loading...

Share This Page