Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET 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 September 11th, 2004, 12:09 AM
Authorized User
 
Join Date: Sep 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default post result on a different page

Hi:

i'm developing a web based application in VB .NET. I have a form where a user can enter some criteria, click on a find button then the results will be posted on a different page on a datagrid. on form1( where the find button is located) i placed the below code in it:

Response.Redirect("area_find.aspx?code=txtAreaCode &description=txtAreaDescription")

txtAreaCode & txtAreaDescription are the criteria on the form
Code & desription are how they are defined in the database

on form2(where the datagrid will display the information) i placed the below code:

 If Not IsPostBack Then

                Dim v1, v2 As String
                v1 = Request.Form("txtAreaCode.text")
                v1 = Request.QueryString("code")
                v2 = Request.Form("txtAreaDescription.text")
                v2 = Request.QueryString("description")

then the sql code comes...

which should i use? Request.Form or Request.QueryString and how?

thanks in advance
 
Old September 11th, 2004, 11:01 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You can't access the previous forms elements from another form.

I think what you are looking to do is this:

Response.Redirect(String.Format("area_find.aspx?co de={0}&description={1}", txtAreaCode.Text, txtAreaDescription.Text))

This will put the actual text from the search boxes into the querystring of the page you are redirecting to. Then you can use the following to retrieve the values:

v1 = Request.QueryString("code")
v2 = Request.QueryString("description")

You must NOT put this inside the "If Not IsPostback". You are redirecting to this page, not posting back onto it.
 
Old September 12th, 2004, 10:24 PM
Authorized User
 
Join Date: Sep 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your help





Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross Page Post Back problem akhilesh_g ASP.NET 2.0 Professional 2 December 24th, 2007 04:38 AM
Post to Another Page problem Indo77 ASP.NET 2.0 Basics 2 March 8th, 2007 05:31 PM
Cross Page Post Back shario ASP.NET 2.0 Basics 0 June 22nd, 2006 03:44 AM
query result page? CHANGE 1 cedwards Dreamweaver (all versions) 31 July 1st, 2005 12:05 PM





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