Passing parameters using POST from ASP

Results 1 to 2 of 2

Thread: Passing parameters using POST from ASP

  1. #1
    Join Date
    Dec 1969

    Default Passing parameters using POST from ASP

    Here is a common problem: passing parameters to another ASP page. Most often it is handled with<BR> Response.Redirect "page2.asp?param1=" & va1 & "&amp;param2=" & val2<BR><BR>This, however, will fail if the amount of data that needs to be transferred is large. A second solution is to use session variables, but that is both inellegant and inefficient. If the parameters need to be transferred to a different application, it simply doesn&#039;t work.<BR><BR>What remains is form POST. What I usually do in this situation is something along the lines of:<BR> <BR> response.clear<BR> response.write "&#060;html&#062;&#060;form name=""frm1"" action=""...."" method=""POST""&#062;"<BR> response.write "&#060;input type=""hidden"" name=""param1"" value=""val1""&#062;"<BR> response.write "&#060;input type=""hidden"" name=""param2"" value=""val2""&#062;"<BR> ...<BR> response.write "&#060;/form&#062;<BR><BR> &#039;submit the form on load<BR> response.write "&#060;script&#062; document.frm1.submit() &#060;/script&#062;"<BR> response.write "&#060;/html&#062;"<BR><BR>This works pretty well in most cases, but what if the user presses the stop button, or the browser doesn&#039;t support JavaScript?<BR><BR>Bottom line, the question is this: is there a way to initiate a form POST from ASP, by building the headers and then redirecting?<BR><BR>Thank you!

  2. #2
    Join Date
    Dec 1969

    Default Alternatives...

    client side : check XMLHTTP<BR><BR>server side : AspHTTP<BR><BR>see discussion at <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts