473,394 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

WebRequest : how to submit name-value pairs?

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


Nov 19 '05 #1
3 1662
I suggest using System.Net.WebClient that alklows to provide a name/value
collection...

Patrice
--

"TR" <TR@anonymous.biz> a écrit dans le message de
news:Oy**************@TK2MSFTNGP09.phx.gbl...
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


Nov 19 '05 #2
Hi TR:

You can write those name-value pairs into a stream and perform a POST operation.
There are some samples here:
http://odetocode.com/Articles/162.aspx

I sincerely hope this helps,

--
Scott
http://www.OdeToCode.com/blogs/scott/
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

Nov 19 '05 #3
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
"Scott Allen" <sc***@nospam.OdeToCode.com> wrote in message
news:43*********************@msnews.microsoft.com. ..
Hi TR:

You can write those name-value pairs into a stream and perform a POST operation.

There are some samples here:
http://odetocode.com/Articles/162.aspx

I sincerely hope this helps,

--
Scott
http://www.OdeToCode.com/blogs/scott/
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


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Taggy | last post by:
hi, Can someone help me with this. I am having this codes: WebRequest myRequest = WebRequest.Create( myurl ); -line1 WebResponse myResponse = myRequest.GetResponse(); -line2 ...... to get...
2
by: Keith Selbee | last post by:
I am trying to submit data to a webpage in the form of a post and my code is below. It is a function that takes a url and the post content as strings and then performs the post. But as soon as I...
5
by: mammothman42 | last post by:
Hi Sorry to be posting slabs of code, but i simply can't get this code to work. I continue to get error 405, method not allowed at req.GetRequestStream(). Can't for the life of me figure out...
0
by: vMike | last post by:
I don't know if I can explain this here, but I will try. I am using WebRequest/WebResponse to get product information from another website then put the selections in a shopping cart of the remote...
12
by: ThyRock | last post by:
I am working on a WebRequest accessing the US Postal Service WebTools test API. This service uses a DLL file (ShippingAPITest.dll) with a query string which includes XML. The web service accepts...
1
by: John | last post by:
I am in need to find a way to get the HTML from an internal URL. For example: I have page : default.aspx?page=Test, I need to get HTML of that page after rendering. At first thought, I would...
0
by: jesper.hvid | last post by:
Hi. I've noticed, after moving some of our code to 2.0, that System.Net.WebRequest.Create(System.String) and System.Uri(System.String) no longer behave as they did in 1.1 framework. Example:...
6
by: Bob | last post by:
Hi, I am new to using a web resource which is not a webservice and I am spinning my wheels with the webrequest class. I am trying to interact with a URI that has been given to me. It is say...
3
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I'm trying to create a call to a web page to validate and register software. The code I'm using is: Private Sub OK_Click(ByVal sender As...
3
by: Lloyd Dupont | last post by:
there is a PHP file with which I try to communicate. there is a simple HTML like that: "<form action='feedback.php' method='POST'>blablabl</form>" now I try to write some C# code to invoke the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.