Need help with POST method to an asp page 
Author Message
 Need help with POST method to an asp page

I am trying to do a POST method to an ASP page I have created that will
return in information. The problem is that the VB.Net code below is
returning the actual ASP code for that page (hiddenpage.asp) and not
returning the information I need (from resultcode.asp). Can anyone help?

Option Strict On
Option Explicit On

Imports System.Net
Imports System.Net.Sockets
Imports System
Imports Scripting
Imports System.Management
Imports System.Text
Imports System.IO

Dim webAddress As String = " http://www.*-*-*.com/ ;
Dim webClientID As WebClient = New WebClient()
Dim parameterTable As New
System.Collections.Specialized.NameValueCollection()

With parameterTable
     .Add("COMPANYNAME", "ABC, Inc.")
     .Add("USERNAME", "SPEEDY RABBIT")
     .Add("OTHERINFO", "123456789")
End With

Dim responseArray As Byte() = webClientID.UploadValues(webAddress, "POST",
parameterTable)
Debug.Write(System.Text.Encoding.ASCII.GetString(responseArray))

***********************************************************************
hiddenpage.asp

<FORM Name="Registration Form" ACTION="resultCode.asp" METHOD="POST">
Company Name: <INPUT TYPE="TEXT" NAME="COMPANYNAME"> <BR>
User Name: <INPUT TYPE="TEXT" NAME="USERNAME"> <BR>
Other Info: <INPUT TYPE="TEXT" NAME="OTHERINFO"> <BR>
<INPUT TYPE=RESET VALUE="CLEAR">
<INPUT TYPE=SUBMIT VALUE="SUBMIT">
</FORM>

************************************************************************
resultcode.asp

<% 'VBScript
Response.Write "Your special number is: 123943" & "<BR>"
Response.Write "For Company: " & Request.Form(1)
%>



Fri, 27 May 2005 21:29:04 GMT  
 Need help with POST method to an asp page
Have you tried:

"http://www.somecompany.com/hiddenpage.asp?"


Quote:
> I am trying to do a POST method to an ASP page I have created that will
> return in information. The problem is that the VB.Net code below is
> returning the actual ASP code for that page (hiddenpage.asp) and not
> returning the information I need (from resultcode.asp). Can anyone help?

> Option Strict On
> Option Explicit On

> Imports System.Net
> Imports System.Net.Sockets
> Imports System
> Imports Scripting
> Imports System.Management
> Imports System.Text
> Imports System.IO

> Dim webAddress As String = "http://www.somecompany.com/hiddenpage.asp"
> Dim webClientID As WebClient = New WebClient()
> Dim parameterTable As New
> System.Collections.Specialized.NameValueCollection()

> With parameterTable
>      .Add("COMPANYNAME", "ABC, Inc.")
>      .Add("USERNAME", "SPEEDY RABBIT")
>      .Add("OTHERINFO", "123456789")
> End With

> Dim responseArray As Byte() = webClientID.UploadValues(webAddress, "POST",
> parameterTable)
> Debug.Write(System.Text.Encoding.ASCII.GetString(responseArray))

> ***********************************************************************
> hiddenpage.asp

> <FORM Name="Registration Form" ACTION="resultCode.asp" METHOD="POST">
> Company Name: <INPUT TYPE="TEXT" NAME="COMPANYNAME"> <BR>
> User Name: <INPUT TYPE="TEXT" NAME="USERNAME"> <BR>
> Other Info: <INPUT TYPE="TEXT" NAME="OTHERINFO"> <BR>
> <INPUT TYPE=RESET VALUE="CLEAR">
> <INPUT TYPE=SUBMIT VALUE="SUBMIT">
> </FORM>

> ************************************************************************
> resultcode.asp

> <% 'VBSCRIPT
> Response.Write "Your special number is: 123943" & "<BR>"
> Response.Write "For Company: " & Request.Form(1)
> %>



Sat, 28 May 2005 02:58:36 GMT  
 Need help with POST method to an asp page
I put that there for an example......

You will notice that I included the ASP code that I have done, but having a
nightmare of a time with it....

Any ideas?



Quote:
> Have you tried:

> "http://www.somecompany.com/hiddenpage.asp?"



> > I am trying to do a POST method to an ASP page I have created that will
> > return in information. The problem is that the VB.Net code below is
> > returning the actual ASP code for that page (hiddenpage.asp) and not
> > returning the information I need (from resultcode.asp). Can anyone help?

> > Option Strict On
> > Option Explicit On

> > Imports System.Net
> > Imports System.Net.Sockets
> > Imports System
> > Imports Scripting
> > Imports System.Management
> > Imports System.Text
> > Imports System.IO

> > Dim webAddress As String = "http://www.somecompany.com/hiddenpage.asp"
> > Dim webClientID As WebClient = New WebClient()
> > Dim parameterTable As New
> > System.Collections.Specialized.NameValueCollection()

> > With parameterTable
> >      .Add("COMPANYNAME", "ABC, Inc.")
> >      .Add("USERNAME", "SPEEDY RABBIT")
> >      .Add("OTHERINFO", "123456789")
> > End With

> > Dim responseArray As Byte() = webClientID.UploadValues(webAddress,
"POST",
> > parameterTable)
> > Debug.Write(System.Text.Encoding.ASCII.GetString(responseArray))

> > ***********************************************************************
> > hiddenpage.asp

> > <FORM Name="Registration Form" ACTION="resultCode.asp" METHOD="POST">
> > Company Name: <INPUT TYPE="TEXT" NAME="COMPANYNAME"> <BR>
> > User Name: <INPUT TYPE="TEXT" NAME="USERNAME"> <BR>
> > Other Info: <INPUT TYPE="TEXT" NAME="OTHERINFO"> <BR>
> > <INPUT TYPE=RESET VALUE="CLEAR">
> > <INPUT TYPE=SUBMIT VALUE="SUBMIT">
> > </FORM>

> > ************************************************************************
> > resultcode.asp

> > <% 'VBSCRIPT
> > Response.Write "Your special number is: 123943" & "<BR>"
> > Response.Write "For Company: " & Request.Form(1)
> > %>



Sat, 28 May 2005 07:38:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. From within ASP page - do a POST to another ASP

2. need help with VB "POST" Method

3. Need help POSTING from asp script

4. NEED HELP - POST AND ASP

5. HELP NEEDED - URGENT - POST AND ASP

6. ASP: Preparing strings to be posted with the get method

7. Read client table data via ASP Request method after posting a form

8. POST method from ASP's ITC?

9. Problem posting xml from vb.net client to asp classic page

10. British Pound sign disappears when POSTing from ASP to ASPX (VB.NET) page

11. Posting to an ASP page with HttpWebRequest

12. help needed with my first asp page

 

 
Powered by phpBB® Forum Software