WebRequest : how to submit name-value pairs?

T

TR

A company that lets affiliates search its database assumes that affiliates
will paste code, which looks something like this, into their web pages:

<form method="GET" name="search_5"
action="http://www.somedomain.com/articles/results.xml" target="_blank">
<!-- Hidden values to be passed to the stored proc -->
<input type="hidden" name="XTYPE" value="FR">
<input type="hidden" name="TG" value="1">
<input type="hidden" name="CRW" value="MOO">
....

How would this be done server-side with a WebRequest object? How would the
hidden input type values be supplied to the WebRequest that is created with
the "results.xml" URI ?

Dim WR as WebRequest =
WebRequest.Create(http://www.somedomain.com/articles/results.xml/)
'// supply hidden input values ?

Thanks
TR
 
P

Patrice

I suggest using System.Net.WebClient that alklows to provide a name/value
collection...

Patrice
 
T

TR

My thanks Scott and Patrice for their suggestions. The website Scott
supplied is very helpful. But there is one aspect of this handshake between
our pages and theirs which still confuses me. When we took their
old-fashioned approach and pasted their code into a barebones HTML document,
when their form is submitted a complete HTML page content (with multiple
columns, links, and scripting) is returned and placed in a new popup window.
They have target="_blank" as part of their <FORM> definition. We are
required legally to display that entire page and cannot parse out only the
content that interests us :)

Now, if we take the more modern programmatic approach offered by ASP.NET and
use either a WebClient or WebRequest object, how do we inject the stream
returned to us into a new popup window? In other words, when working with
the WebRequest object, is there counterpart functionality to target="_blank"
that would let me inject the stream (converted to String) into a new popup
window?
Thanks
TR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top