Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

POST data to page

Status
Not open for further replies.

digiduck

Programmer
Apr 4, 2003
95
US
I need to POST data to another page all in code, I'm picturing something like this.

post_data.params.add("name", "value")
server.execute("url", post_data)

yes i know server.execute won't do that but you get it what i mean right? If someone could give me some code examples of how to do this it would be a great help. Thanks

ud


tkc
 
Hi digiduck

You want to post to a page programtically and this page will return a result to your code? rather than the page being displayed in the browser?

If so you can use the System.Net.HttpWebRequest class to do this. Its pretty similar to XMLHTTP post in ASP.

Heres a link to the MSDN .NET class library which has some code exmaples..


You will need to pay particular attention to the ContentType property to correctly incode the data and add it to the request stream.

hope this helps

Rob

Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
 
thank you i'll have a look at that. i'm actually executing a PHP script with params passed via POST. The script doesn't return anything it just executes and lets my page continue processing, more or less like a remote sub routine. thanks

ud


tkc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top