942,963 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 393
  • ASP.NET RSS
Jul 26th, 2010
0

passing data between parent usercontrol and child usercontrol

Expand Post »
Hi everyone,
I have a certain page let's call it main.aspx which hosts multiple usercontrols.
One of these usercontrols (Say UC1.ascx) contains another usercontrol
(say UC2.ascx). Now the UC2 is a self contained control which
does everything by itself. The only thing it needs is some peice
of data ( a string ) from its parent control UC1.

On the UC1.ascx page the UC2 is included declaratively(it was not added dynamically), and also the UC2 is initially hidden in the panel which is being modally poped up depending on user interaction with UC1.
So the big picture:
UC2.ascx -> UC1.ascx -> Main.aspx (UC2 is inside UC1, which inturn is on Main page)
or if you will
Main.aspx -> UC1.ascx -> UC2.ascx

My question is, how can i pass the string to UC2 from UC1???

I have read a lot of posts and howtos. I've tried public property of UC2 which is being set on a button_click from UC1. But for some reason, the property doesn't stick. It is just getting nulled all the time once UC2 loads and renders.

I've tried event delegates and event handlers, but that also didn't work for me. The events were never caught.

I have tried event bubbling, but for some reason the OnBubbleEvent inside UC2 was only catching the event once the UC2 was being closed.

Can some1 help please???
Appriciate all the help.
Last edited by dimaash; Jul 26th, 2010 at 1:54 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dimaash is offline Offline
3 posts
since Jun 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Calling SPROC to create temp table via web application
Next Thread in ASP.NET Forum Timeline: Online voting !!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC