473,434 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

POST

I have a simple SQL query that is run inside a asp page. I would
normally display the results using the response.write("my name is: " &
name) if I wanted the output displayed. On this occasion I want to
post the results to another .asp page. How do I get the "name" field
into Request.Form("name") that I need to pass to the next .asp page?
Jul 30 '08 #1
4 2408
"paulmitchell507" <pa*************@googlemail.comwrote in message
news:c2**********************************@m73g2000 hsh.googlegroups.com...
I have a simple SQL query that is run inside a asp page. I would
normally display the results using the response.write("my name is: " &
name) if I wanted the output displayed. On this occasion I want to
post the results to another .asp page. How do I get the "name" field
into Request.Form("name") that I need to pass to the next .asp page?
<form>
<input type="text" name="myName" value="<%=Request.Form("name")%">
</form>
Jul 30 '08 #2
paulmitchell507 wrote:
I have a simple SQL query that is run inside a asp page. I would
normally display the results using the response.write("my name is: " &
name)
Err ... the parentheses are not needed unless you are using javascript
if I wanted the output displayed. On this occasion I want to
post the results to another .asp page. How do I get the "name" field
into Request.Form("name") that I need to pass to the next .asp page?
Use a hidden field:
<form>
....
<input type="hidden" name="name" value="<%=Request.Form("name")%">
....
</form>

Note: <%= is shorthand for <%Response.Write

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 30 '08 #3
On Jul 30, 1:36*pm, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
paulmitchell507 wrote:
I have a simple SQL query that is run inside a asp page. *I would
normally display the results using the response.write("my name is: " &
name)

Err ... the parentheses are not needed unless you are using javascript
if I wanted the output displayed. *On this occasion I want to
post the results to another .asp page. *How do I get the "name" field
into Request.Form("name") that I need to pass to the next .asp page?

Use a hidden field:
<form>
...
<input type="hidden" name="name" value="<%=Request.Form("name")%">
...
</form>

Note: <%= is shorthand for <%Response.Write

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Thank you taking the time to reply to my basic question!
To explain a little further, after I run the SQL, I am left with a
single value for holiday_ID. I then call the following to pass the
holiday_ID to another asp file with our any user input
<form
method=post
action='email2.asp'
name='myform'>

<input
type=hidden
name='myname'
value="<%=Request.Form("holiday_id")%>">

</form>

<script>
window.onLoad = document.myform.submit();
</script>

I am trying to display the holiday_ID in the email2.asp page as I am
not sure that the holiday_ID is sent. I have put the following on the
email2.asp page,

<%
'declare your variables
Dim holiday_ID

'Receiving values from Form, assign the values entered to variables
holiday_ID = Request.Form("holiday_ID")

If holiday_ID <>"" Then
Response.write("No records returned.")
Else
Response.Write("my id is:" & holiday_ID)
End If
%>

If I run the app, "my id is" gets displayed but no holiday_ID. It
would appear that somthing is passed to the email2something.asp page,
but what?
I am sure it's obvious, I am not familiar with asp!
Jul 30 '08 #4
paulmitchell507 wrote:
On Jul 30, 1:36 pm, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
>paulmitchell507 wrote:
>>I have a simple SQL query that is run inside a asp page. I would
normally display the results using the response.write("my name is:
" & name)
>>if I wanted the output displayed. On this occasion I want to
post the results to another .asp page. How do I get the "name" field
into Request.Form("name") that I need to pass to the next .asp page?

Use a hidden field:
<form>
...
<input type="hidden" name="name" value="<%=Request.Form("name")%">
...
</form>

Note: <%= is shorthand for <%Response.Write
>
Thank you taking the time to reply to my basic question!
To explain a little further, after I run the SQL, I am left with a
single value for holiday_ID. I then call the following to pass the
holiday_ID to another asp file with our any user input
<snip>
<input
type=hidden
name='myname' <====
value="<%=Request.Form("holiday_id")%>">
<snip>
>
'Receiving values from Form, assign the values entered to variables
holiday_ID = Request.Form("holiday_ID")
You called the hidden element "myName", not "holiday_ID"
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 30 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST....
1
by: khawar | last post by:
my application is in asp.net using C# hi guys having a complicated problem i am using payflowlink to process CC payments I have to send a httppost to their servers. The problem is how do i do a...
2
by: Matt | last post by:
When we submit the form data to another page, we usually do the following: <form action="display.aspx" method="post"> will submit the form data and open display.asp in the current browser ...
1
by: Manuel | last post by:
I have to log into a website and retrieve some information. The problem is that the post isn't "normal". I'm used to passing post values in the form of: Variable1=Value1&Variable2=Value2 etc. I...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
24
by: moriman | last post by:
Hi, The script below *used* to work. I have only just set up a server, PHP etc again on my Win98 system and now it doesn't? On first loading this page, you would have $p = and the button...
9
by: c676228 | last post by:
Hi, I am new to this discussion forum. I started to post questions on this forum since this Jan. and got many good responses and I am very appreciated to those who are willing to help with their...
3
by: JansenH | last post by:
We have implemented a 'HTTP Post' client in C# that posts Xml documents to a webserver. This is working fine if the post rate is one post for every 20 seconds. But if the post rate is increased to...
10
by: Peter Michaux | last post by:
Hi, All Ajax libraries I've read use encodeURIComponent() on the name- value pairs extracted from forms before POST ing the result to the server with and xmlhttprequest. I can understand why...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.