Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > POST

Reply
 
 
paulmitchell507
Guest
Posts: n/a
 
      07-30-2008
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?
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      07-30-2008
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.


 
Reply With Quote
 
 
 
 
paulmitchell507
Guest
Posts: n/a
 
      07-30-2008
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!
 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      07-30-2008
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Doing a serverside post and ending up at post server John Dalberg ASP .Net 8 09-23-2004 09:17 PM
Modelsim post place and route/Post Translate issues Sridhar Hegde VHDL 2 09-13-2004 02:43 PM
wlftg17 modelsim temp file beeing too big (corret post, ignore the old post) Oleg VHDL 0 04-05-2004 03:31 AM
Post post post. Shel-hed Computer Support 2 11-08-2003 07:41 AM
asp.net C# payflowlink post and capturing silent post khawar ASP .Net 2 10-28-2003 08:41 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57