Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Passing values between user controls

Reply
Thread Tools

Passing values between user controls

 
 
Peter K
Guest
Posts: n/a
 
      01-13-2010
Hi

I have a page (aspx) which contains many ascx controls.

One of the ascx controls has a date-selection control, and when this is
changed some of the other ascx's have to respond by changing their display
appropriately.

What is the best way of achieving this?

Presently, in the "date selection" control, I fire an event when the date
selection changes.
The main page (aspx) subscribes to this event (from which it obtains the new
date), and then calls special public methods on the other ascx's to supply
them the date.

Is this an ok method? It means the aspx has to know all its child ascx's
which need to know the new date. Is it possible to fire another event in the
aspx, which the relevant child ascx's subscribe to?


Thanks,
Peter


 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      02-18-2010
It sounds like a very efficient technique for accomplishing your goal. Have
you actually tried it yet, or are you just asking before trying to write the
code (not that either one is bad)? I am asking this because if you have
tried it and there was a problem, we may be able to help you more if you
show us the code and/or error. Good luck!
--
Nathan Sokalski

http://www.nathansokalski.com/

"Peter K" <> wrote in message
news:#...
> Hi
>
> I have a page (aspx) which contains many ascx controls.
>
> One of the ascx controls has a date-selection control, and when this is
> changed some of the other ascx's have to respond by changing their display
> appropriately.
>
> What is the best way of achieving this?
>
> Presently, in the "date selection" control, I fire an event when the date
> selection changes.
> The main page (aspx) subscribes to this event (from which it obtains the
> new date), and then calls special public methods on the other ascx's to
> supply them the date.
>
> Is this an ok method? It means the aspx has to know all its child ascx's
> which need to know the new date. Is it possible to fire another event in
> the aspx, which the relevant child ascx's subscribe to?
>
>
> Thanks,
> Peter
>

 
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
Pass values between user controls? =?Utf-8?B?RGF2ZQ==?= ASP .Net 1 09-13-2010 05:06 PM
Passing values to user controls - naughty problem Dave E ASP .Net Web Controls 3 07-03-2006 06:23 AM
passing values between controls evandela@bigpond.net.au ASP .Net 1 03-20-2006 01:58 AM
passing values between controls evandela@bigpond.net.au ASP .Net 0 03-20-2006 01:27 AM
Passing values between Custom controls? Arulraja ASP .Net Building Controls 1 10-23-2003 01:11 AM



Advertisments