C
csgraham74
Just a quick one - im trying to post values to a page using a method
below. im coding in asp.net vb. i was wondering how i also redirect to
the page as well as post the values at the same time. e.g. in html it
would be something like
<form action=https://www.text.cgi method=post>
<input type=visible name="val1" value="<%=val1%>">
<input type=visible name="val2" value="<%=val2%>">
<input type=submit value="Proceed to server" id="Submit1"
language="javascript" onclick="return Submit1_onclick()">
</form>
posting in asp.net - i think ?????? any help appreciated
Public Shared Function readHtmlPage(ByVal postData As String) As
String
Dim result As String = ""
Dim strPost As String = postData
Dim myWriter As StreamWriter
Dim objRequest As HttpWebRequest = WebRequest.Create("https://
www.test.cgi")
objRequest.Method = "POST"
objRequest.ContentLength = strPost.Length
objRequest.ContentType = "application/x-www-form-urlencoded"
Try
myWriter = New StreamWriter(objRequest.GetRequestStream())
myWriter.Write(strPost)
Catch e As Exception
Return e.Message
Finally
myWriter.Close()
End Try
Dim objResponse As HttpWebResponse = objRequest.GetResponse()
Dim sr As StreamReader
sr = New StreamReader(objResponse.GetResponseStream())
result = sr.ReadToEnd()
sr.Close()
Return result
End Function
below. im coding in asp.net vb. i was wondering how i also redirect to
the page as well as post the values at the same time. e.g. in html it
would be something like
<form action=https://www.text.cgi method=post>
<input type=visible name="val1" value="<%=val1%>">
<input type=visible name="val2" value="<%=val2%>">
<input type=submit value="Proceed to server" id="Submit1"
language="javascript" onclick="return Submit1_onclick()">
</form>
posting in asp.net - i think ?????? any help appreciated
Public Shared Function readHtmlPage(ByVal postData As String) As
String
Dim result As String = ""
Dim strPost As String = postData
Dim myWriter As StreamWriter
Dim objRequest As HttpWebRequest = WebRequest.Create("https://
www.test.cgi")
objRequest.Method = "POST"
objRequest.ContentLength = strPost.Length
objRequest.ContentType = "application/x-www-form-urlencoded"
Try
myWriter = New StreamWriter(objRequest.GetRequestStream())
myWriter.Write(strPost)
Catch e As Exception
Return e.Message
Finally
myWriter.Close()
End Try
Dim objResponse As HttpWebResponse = objRequest.GetResponse()
Dim sr As StreamReader
sr = New StreamReader(objResponse.GetResponseStream())
result = sr.ReadToEnd()
sr.Close()
Return result
End Function