or
I defined, 2 comboxes.
Combox1 is defined with selectIndexchanges: this will populate data for combox2.
That's work fine, unless I define a button with click_event. Once I click the button, the selectIndexChanged of Combox1 is also called. Not sure I did something or it is naturally new bug of Ajax Q1 2009? I did trying dropdownlist, it works fine. Could you give some suggestion?
Cheers,
Duy
Notes: I also posted this message in forum suggestion.
<html> |
<title>HTTP Post Testing</title> |
<body> |
<form action=http://www.example.com/postdata |
enctype="multipart/form-data" method="post" name="testform"> |
<input id="user_login" name="user[login]" size="30" type="hidden" |
value="user01" /> |
<input id="user_password" name="user[password]" size="30" |
type="hidden" value="123456" /> |
<table> |
<tr> |
<td>File:</td> |
<td><input id="file" name="file" |
type="file" /></td> |
</tr> |
<tr> |
<td colspan="2"><input name="commit" |
type="submit" value="Upload" name="upload"/></td> |
</tr> |
</table> |
</form> |
</body> |
</html> |
Try |
Dim request As HttpWebRequest = CType(WebRequest.Create(Me.txtURL.Text), HttpWebRequest) 'this textbox contains the target URL of the request |
' Set the Method property of the request to POST. |
request.Method = "POST" |
request.Accept = "*/*" |
request.UserAgent = "curl/7.16.3" |
request.ProtocolVersion = HttpVersion.Version11 |
request.Referer = "http://www.mydomain.com/" |
request.SendChunked = True |
System.Net.ServicePointManager.Expect100Continue = False |
' Create POST data and convert it to a byte array. |
Dim postData As String = "" |
postData += Boundary + Chr(13) + Chr(10) + "Content-Disposition: form-data; name=""user[login]""" + Chr(13) + Chr(10) + Chr(13) + Chr(10) |
postData += "gape" + Chr(13) + Chr(10) |
postData += Boundary + Chr(13) + Chr(10) + "Content-Disposition: form-data; name=""user[password]""" + Chr(13) + Chr(10) + Chr(13) + Chr(10) |
postData += "telipoint8" + Chr(13) + Chr(10) |
postData += Boundary + Chr(13) + Chr(10) + "Content-Disposition: form-data; name=""file""; filename=""helpcurl.txt""" + Chr(13) + Chr(10) |
postData += "Content-Type: text/plain" + Chr(13) + Chr(10) + Chr(13) + Chr(10) |
postData += "fdfgfggfbfgggggggggggggggg" + Chr(13) + Chr(10) + Boundary + "--" + Chr(13) + Chr(10) |
Dim encoding As New System.Text.ASCIIEncoding() |
Dim byteArray As Byte() = encoding.GetBytes(postData) |
' Set the ContentType property of the WebRequest. |
'request.ContentType = "application/x-www-form-urlencoded" |
request.ContentType = "multipart/form-data; boundary=" + Me.Boundary + vbCrLf + vbCrLf |
' Set the ContentLength property of the WebRequest. |
request.ContentLength = byteArray.Length |
' Get the request stream. |
Dim dataStream As Stream = request.GetRequestStream() |
' Write the data to the request stream. |
dataStream.Write(byteArray, 0, byteArray.Length) |
' Close the Stream object. |
dataStream.Close() |
' Get the response. |
Dim response As WebResponse = request.GetResponse() |
' Display the status. |
MsgBox(CType(response, HttpWebResponse).StatusDescription, MsgBoxStyle.Information, "Response Code") |
' Get the stream containing content returned by the server. |
dataStream = response.GetResponseStream() |
' Open the stream using a StreamReader for easy access. |
Dim reader As New StreamReader(dataStream) |
' Read the content. |
Dim responseFromServer As String = reader.ReadToEnd() |
' Display the content. |
txtResponse.Text = responseFromServer 'this textbox shows the response from the server |
' Clean up the streams. |
reader.Close() |
dataStream.Close() |
response.Close() |
Catch Ex As Exception |
MsgBox(Ex.Message, MsgBoxStyle.Exclamation, "Error Encountered") |
End Try |
<% |
test1 = Request.Form("user[login]") |
test2 = Request.Form("user[password]") |
Response.Write(test1 + "<br>" + test2) |
%> |