"John Saunders" <jo***********@ surfcontrol.com > wrote in message news:<Or******* *******@TK2MSFT NGP12.phx.gbl>. ..
"Jeff Baker" <jb*****@hotmai l.com> wrote in message
news:78******** *************** **@posting.goog le.com... How does one post to an ASPX page using the WebClient when the form
name is required?
Could you be more specific?
Dim client As New WebClient
client.Headers. Add("Content-Type",
"applicatio n/x-www-form-urlencoded")
Dim myQueryStringCo llection As New
System.Collecti ons.Specialized .NameValueColle ction
myQueryStringCo llection.Add("u sername", "test")
myQueryStringCo llection.Add("p assword", "tickle")
client.QueryStr ing = myQueryStringCo llection
Dim ResponseData As Byte() =
client.Download Data("http://www.mytestsite. com/index.aspx")
From the code above I'm posting the "username" and "password" to the
"index.aspx " page and downloading the page ingo the ResponseData Byte
array. What happens if the index.aspx page has more than one form and
I want to post to a specific form OR if the index.aspx page is
specifically looking for a form name to via the request object??
How can I specifiy the form name when using the WebClient class to
post information to a page/form??