Passing Data Between Two ASCX controls within a ASPX page

I have a .aspx page in which I have two .ascx controls:

SearchForm.ascx & Summary.ascx

In SearchForm.ascx I have a form containing Name,Email,Phone etc.

I can't figure out a way to display the form data on the Summary.ascx - can anyone help?
LVL 1
JimDestructAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ted BouskillSenior Software DeveloperCommented:
So the search form captures the information and the summary displays it?
0
JimDestructAuthor Commented:
the SearchForm.ascx contains the form itself - OnClick of the submit button  I want the details of the form fields to be accessible in Summary.ascx
0
Ted BouskillSenior Software DeveloperCommented:
What you need to do is expose public properties on the Summary.ascx control that can be used by the page to populate it.  Then when the OnClick is pressed and your page executes code in response, the page can then populate the Summary.ascx control using the public properties.  Sometimes the easiest way to do this is to declare the UI objects in the Summary.ascx control as Public instead of protected.
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

JimDestructAuthor Commented:
Ok I kinda see what your coming from but havent dealt with public properties before so not sure how to go about it, can you show me what you mean?
0
JimDestructAuthor Commented:
p.s - I'm using VB.NET :)
0
Ted BouskillSenior Software DeveloperCommented:
Here is a sample from the Microsoft site: http://msdn2.microsoft.com/en-us/library/26db8ysc(VS.80).aspx

NOTE: You don't have to set the properties in the HTML tag.  You can do it in your code as well.
0
JimDestructAuthor Commented:
Excellent! OK I get how to set the public string but how then do you display the public string in the second ascx control?
0
Ted BouskillSenior Software DeveloperCommented:
Use another property on the other control.  They are get/set so you get the property from one control when the submit fires and set it on the other control.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JimDestructAuthor Commented:
Thanks for your help with this one, I managed to crack it!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.