954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

passing data between parent usercontrol and child usercontrol

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.

dimaash
Newbie Poster
3 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You