Home All Groups Group Topic Archive Search About

Passing values between user controls in separate forms

Author
10 Mar 2006 9:31 PM
campwes
Hi!  I have what I hope is a simple problem.  I have 2 web forms.  The first
form is a welcome page with a textbox and button (in a user control).  What's
supposed to happen is that a user will enter data in the textbox and click
the button.  The event handler for the button then has to send that value to
a the second web form containing a user control that can accept that value as
a parameter in a db query and display the user control with the results of
the query.  I can set the value of the query in the user control and display
the page on its own, but how do I get the textbox value from another form? 
I'll happily supply code if my description isn't clear.

Thanks,

campwes

Author
11 Mar 2006 11:45 AM
Phillip Williams
The page's lifecycle starts and ends in every browser request.  To persist
data between pages use the Session, QueryString or Cookies.

http://msdn2.microsoft.com/en-us/library/87069683.aspx
http://msdn2.microsoft.com/en-us/library(d=robot)/system.web.httprequest.querystring.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchaspnetcookies101.asp
Show quoteHide quote
"campwes" wrote:

> Hi!  I have what I hope is a simple problem.  I have 2 web forms.  The first
> form is a welcome page with a textbox and button (in a user control).  What's
> supposed to happen is that a user will enter data in the textbox and click
> the button.  The event handler for the button then has to send that value to
> a the second web form containing a user control that can accept that value as
> a parameter in a db query and display the user control with the results of
> the query.  I can set the value of the query in the user control and display
> the page on its own, but how do I get the textbox value from another form? 
> I'll happily supply code if my description isn't clear.
>
> Thanks,
>
> campwes