hi Douglas,
Below i am providing you with a quick copy and paste from the docs. For a
working example of how this can work for you, go to :
http://www.bluevisionsoftware.com/WebSite/TipsAndTricksDetails.aspx?Name=PayPal
Requests and Responses in the .NET Framework
The .NET Framework uses specific classes to provide the three pieces of
information required to access Internet resources through a request/response
model: the Uri class, which contains the URI of the Internet resource you
are seeking; the WebRequest class, which contains a request for the
resource; and the WebResponse class, which provides a container for the
incoming response.
Client applications create WebRequest instances by passing the URI of the
network resource to the WebRequest.Create method. This static method creates
a WebRequest instance for a specific protocol, such as HTTP. The WebRequest
instance that is returned provides access to properties that control both
the request to the server and access to the data stream that is sent when
the request is made. The GetResponse method on the WebRequest instance sends
the request from the client application to the server identified in the URI.
In cases in which the response might be delayed, the request can be made
asynchronously using the BeginGetResponse method on the WebRequest instance,
and the response can be returned at a later time using the EndGetResponse
method.
The GetResponse and EndGetResponse methods return a WebResponse instance
that provides access to the data returned by the server. Because this data
is provided to the requesting application as a stream by the
GetResponseStream method, it can be used in an application anywhere data
streams are used.
The WebRequest and WebResponse classes are the basis of pluggable
protocols-an implementation of network services that enables you to develop
applications that use Internet resources without worrying about the specific
details of the protocol that each resource uses. Descendant classes of
WebRequest are registered with the WebRequest class to manage the details of
making the actual connections to Internet
As an example, the HttpWebRequest class manages the details of connecting to
an Internet resource using HTTP. By default, when the WebRequest.Create
method encounters a URI that begins with "http:" or "https:" (the protocol
identifiers for HTTP and secure HTTP), the WebRequest instance that is
returned can be used as is, or it can be typecast to HttpWebRequest to
access protocol-specific properties. In most cases, the WebRequest instance
provides all the necessary information for making a request.
Any protocol that can be represented as a request/response transaction can
be used in a WebRequest. You can derive protocol-specific classes from
WebRequest and WebResponse and then register them for use by the application
with the static WebRequest.RegisterPrefix method.
When client authorization for Internet requests is required, the Credentials
property of the WebRequest supplies the necessary credentials. These
credentials can be a simple name/password pair for basic HTTP or digest
authentication, or a name/password/domain set for NTLM or Kerberos
authentication. One set of credentials can be stored in a NetworkCredentials
instance, or multiple sets can be stored simultaneously in a CredentialCache
instance. The CredentialCache uses the URI of the request and the
authentication scheme that the server supports to determine which
credentials to send to the server.
DOUGLAS HEESTAND said:
After more fiddling it seems I can't get it to co-exist with form
validation. Changing the value of the "onSubmit" property of the form
causes the last validation to be bypassed. If I try to change the
value of the "onClick" property of the submit button I get something
like this when it is rendered into HTML:
<input type="submit" name="btnSubmit" value="Submit"
onclick="javascript:document.forms[0].action='
http://othersite.com/otherform
.html;if
(typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); "
language="javascript" id="btnSubmit" />
So it submits before validating and I can't make it validate first. I
could create a custom javascript function but that is starting to get
hokey and just plain ugly. I'd rather use a vanilla html form at that
point!
I can't believe ASP.NET can't handle this situation!
-Doug