473,320 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
Nov 19 '05 #1
2 1182
- 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 <ga*@forever.com> wrote:
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Nov 19 '05 #2
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

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lecture Snoddddgrass | last post by:
Hi, When I create a UserControl-derived object, I often expose various public properties. One of the things that I hate about the WinForms designer is that if I decide to embed one of these...
13
by: Will Pittenger | last post by:
I have a Control derived class. When the parent of the control changes the control's Location property, the stack overflows. I have not found a way to find out what was on the stack when it does...
2
by: Mystery Man | last post by:
I have developed a series of user defined controls. These have been placed on a variety of different forms. From within one of these controls, I want to show another dialog directly to the right...
5
by: Nathan Sokalski | last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an...
0
by: John Shum | last post by:
I prepare a UserControl that act as a lookup control, once the code is enter in the TextBox, the description will appear in another TextBox outside the UserControl of the same row in a DataGrid via...
1
by: Will Gillen | last post by:
I know this has probably been asked before, but I can't seem to find a solid answer in any of the archives. First, before my question, please forgive my limited knowledge of the event lifecycle...
1
by: Ray Cassick \(Home\) | last post by:
Ok, here is apparently another odd one... I am (as I said in a previous posting here) building a user control that inherits from System.Windows.Forms.UserControl. This base class contains a...
0
by: Paul | last post by:
Hello, and Good Morning, I need to Cross-page post some values to the target page. Since I am using Master pages and User Controls, I am finding it hard to get the thing working, so I am...
1
by: kferron | last post by:
if i wanted to expose a property on a usercontrol that basically would work like the way the validators work with the ControlToValidate property, whats a reliable way of finding the correct control...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.