Little "Post" Issue

  • Thread starter Thread starter Omar E Contreras
  • Start date Start date
O

Omar E Contreras

Hi guys,
Let me explain what I want to do in just 3 steps:

Step 1:
An HTML page that has a form which passes some data to an aspx page

Step 2:
The aspx page take this values and add some others, lets say VarA = "Fun"

Step 3:
my aspx page send another POST with the first values and the value of VarA
(which is "Emulating" a hidden value OR text input) to a third page that
accepts ONLY Posted values NO QuerryStrings.

The question is: How do I make a Post from code?, I mean, how can I emulate
a HTML form from the script in order to pass some variables to a third
page?.
Thanks in advance.

Omar
 
Thanks but this is NOT what I was looking for.
I want to emulate to submit of data from ASP code not from JavaScript Code.
I don't want to display an page, I just want to execute an ASP page that
just POST data to another page with a Subroutine or a Function, Is this
possible?.
Thanks anyway

Omar

Mark said:
Hi guys,
Let me explain what I want to do in just 3 steps:

Step 1:
An HTML page that has a form which passes some data to an aspx page

Step 2:
The aspx page take this values and add some others, lets say VarA =
"Fun"

Step 3:
my aspx page send another POST with the first values and the value of
VarA (which is "Emulating" a hidden value OR text input) to a third
page that accepts ONLY Posted values NO QuerryStrings.

The question is: How do I make a Post from code?, I mean, how can I
emulate a HTML form from the script in order to pass some variables to
a third page?.
Thanks in advance.

Omar

Write out a form with the action set to the destination page and the
method set to post. In the onload, do a form.submit().

e.x.

<html>
<body onload="document.theform.submit()">
<form name="theform" id="theform" action="<%=destpage%>" method="post">
<input type="hidden" name="VarA" value="<%=VarA%>">
<input type="hidden" name="other" value="<%=Request.Form["other"]%>">
</form>
</body>
</html>


Mark
 
Thanks but this is NOT what I was looking for.
I want to emulate to submit of data from ASP code not from JavaScript
Code. I don't want to display an page, I just want to execute an ASP
page that just POST data to another page with a Subroutine or a
Function, Is this possible?.
Thanks anyway

Omar


In that case, check out the HttpWebRequest and HttpWebResponse classes.
They'll do exactly what you are looking for.

Mark
 
Back
Top