p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Beginning VB 6 (http://p2p.wrox.com/forumdisplay.php?f=75)
-   -   Passing data via querystring (http://p2p.wrox.com/showthread.php?t=69636)

LanceRoss July 25th, 2008 10:51 AM

Passing data via querystring
 
I am a newbie and am writing my first ASP.NET 3.5 form in VB.
I have a ReadOnly mode FormView that pulls the First and Last name fields from a SQL DB based on user input to a textbox. When the form is complete and the user clicks the submit button, I need to pass the first and last names to the Thank You page via a Response.Redirect string. What is the syntax to reference the data in the ReadOnly Formview1 control and then how do I pass that in the codebehind for the submit button?

BrianWren July 25th, 2008 11:37 AM

Let's say you want to pass Bob and Smith, and you are redirecting to ThePage.aspx. After the URL add a question mark, followed by name/value pairs:
Code:

"http://www.ServerName.com/ThePage.aspx?first=Bob&last=smith"
If the data were in variables a & b:
Code:

"http://www.ServerName.com/ThePage.aspx?first=" & a & "&last=" & b
So, as you can see, where a & b are, you can put anything that returns a string...

LanceRoss July 25th, 2008 12:02 PM

Quote:

quote:Originally posted by BrianWren
 Let's say you want to pass Bob and Smith, and you are redirecting to ThePage.aspx. After the URL add a question mark, followed by name/value pairs:
Code:

"http://www.ServerName.com/ThePage.aspx?first=Bob&last=smith"
If the data were in variables a & b:
Code:

"http://www.ServerName.com/ThePage.aspx?first=" & a & "&last=" & b
So, as you can see, where a & b are, you can put anything that returns a string...
Thanks for your reply. I need the exact syntax of identifying the data that is held in the FormView1 - from the codebehind on the submit button, and then I need the syntax for adding that to the querysting and then the syntax to add to the 2nd page codebehind to grab the data from the querystring.

gbianchi July 25th, 2008 12:20 PM

Hi there..

Question, because I don't remember exactly, but doesn't asp.net has a previouspage object where you can obtain that kind of info?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========


All times are GMT -4. The time now is 10:10 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.