Hi John,
You can simulate a post using the WebClient class. Here's the idea:
Sub DoPost()
Dim uriString As String = _
"http://localhost/p4320work/mySpecialPage.aspx"
Dim strGoName As String
strGoName = TextBox1.Text
' Create a new WebClient instance.
Dim myWebClient As New System.Net.WebClient
Dim myNameValueCollection As New _
System.Collections.Specialized.NameValueCollection
myNameValueCollection.Add("go1", strGoName)
myNameValueCollection.Add("Button1", "")
Dim responseArray As Byte() = myWebClient.UploadValues _
(uriString, "POST", myNameValueCollection)
Label1.Text = "Response received was :" & _
System.Text.Encoding.ASCII.GetString(responseArray )
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Call DoPost()
End Sub
Ken
Microsoft MVP [ASP.NET]
"WJ" <Jo*******@HotMail.Com> wrote in message
news:u6**************@TK2MSFTNGP12.phx.gbl...
I have an Asp.Net page that redirects the user to another page with a piece
of data to be passed. Below is the c# instruction:
Response.Redirect("mySpecialPage.aspx?go1="+strGoN ame);
This will expose the "go1" parameter on the Address field of the MS/IE
browser because it uses the "GET" method. Is there a way that I can force
the system to use the "POST" method with the above payload ?
Thanks for your help,
John