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.a spx"
Dim strGoName As String
strGoName = TextBox1.Text
' Create a new WebClient instance.
Dim myWebClient As New System.Net.WebC lient
Dim myNameValueColl ection As New _
System.Collecti ons.Specialized .NameValueColle ction
myNameValueColl ection.Add("go1 ", strGoName)
myNameValueColl ection.Add("But ton1", "")
Dim responseArray As Byte() = myWebClient.Upl oadValues _
(uriString, "POST", myNameValueColl ection)
Label1.Text = "Response received was :" & _
System.Text.Enc oding.ASCII.Get String(response Array)
End Sub
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Call DoPost()
End Sub
Ken
Microsoft MVP [ASP.NET]
"WJ" <Jo*******@HotM ail.Com> wrote in message
news:u6******** ******@TK2MSFTN GP12.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.Redire ct("mySpecialPa ge.aspx?go1="+s trGoName);
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