Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 25th, 2008, 10:51 AM
Registered User
 
Join Date: Jul 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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?
 
Old July 25th, 2008, 11:37 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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...
 
Old July 25th, 2008, 12:02 PM
Registered User
 
Join Date: Jul 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
 
Old July 25th, 2008, 12:20 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

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
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
passing password in in querystring jaya929 ASP.NET 2.0 Professional 5 May 27th, 2008 07:47 AM
Passing more than one querystring in the site map kaushikpulpa ASP.NET 2.0 Basics 1 April 20th, 2007 08:08 AM
Passing a querystring value that contains '&' jfrizelle Classic ASP Databases 3 March 20th, 2006 09:27 PM
Passing URL in a Querystring [email protected] Javascript How-To 3 July 8th, 2004 04:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.