Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 11th, 2004, 12:09 AM
Authorized User
 
Join Date: Sep 2004
Location: Muscat, , Oman.
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
Reply With Quote
  #2 (permalink)  
Old September 11th, 2004, 11:01 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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.
Reply With Quote
  #3 (permalink)  
Old September 12th, 2004, 10:24 PM
Authorized User
 
Join Date: Sep 2004
Location: Muscat, , Oman.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your help
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



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


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