Thursday, March 29, 2012

SERVER SIDE PROCESSING OF DATA

Hi All,

I am developing one application, My requirement is to post data to a third party server and receive acknowledgement, I want to post data at server side, Is it possible to post data with out using any web service or a Active X control.

Thanks

Pavan

use a html form.

set the target property to the server where you want to post

then do form.submit()


To be more clear on my requirement.

I am using html post to send data to a .cfm file, which lies on another server. upon sending data to the cfm page, I need to capture the acknowledgement which is displayed on the .cfm file. Is there any way to achieve this?

Thanks


You could use Msxml2.ServerXMLHTTP.3.0.


Hi,

HttpWebRequest supports makeing a request to a Uniform Resource Identifier (URI).

Here is one example that will give you idea:

string strId = UserId_TextBox.Text;string strName = Name_TextBox.Text;ASCIIEncoding encoding=new ASCIIEncoding();string postData="userid="+strId;postData += ("&username="+strName);byte[] data = encoding.GetBytes(postData);// Prepare web request...HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://localhost/MyIdentity/Default.aspx");myRequest.Method = "POST";myRequest.ContentType="application/x-www-form-urlencoded";myRequest.ContentLength = data.Length;Stream newStream=myRequest.GetRequestStream();// Send the data.newStream.Write(data,0,data.Length);newStream.Close();
 

Thanks a ton for your replies. It's worked for me.Smile

0 comments:

Post a Comment