473,386 Members | 1,779 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,386 software developers and data experts.

I want ot submit a form residing on other domain from my asp.net application.

[I want to submit a form residing on other domain from my asp.net application.] and then get result in my asp.net page(response). I have tried the way in which HTTPWebRequest and HTTPWebResponse objects were used, but no success.
For more clarity, i want to send a container no. to a website providing container tracking and get the result page html in my control.
There is no authentication there. Webite url is "http://www.concorindia.com/containerquery.aspx". Is there any other way to accomplish this?

I am using the code:
Expand|Select|Wrap|Line Numbers
  1. string url = "http://www.concorindia.com/containerquery.aspx";         
  2.  
  3. WebRequest request = WebRequest.Create(url);
  4.  
  5. request.Method = "POST";
  6.  
  7. string postData = "contno=123456&CONTButton1='Submit Query'";
  8.  
  9. byte[] byteArray = Encoding.UTF8.GetBytes(postData);
  10. request.ContentType = "application/x-www-form-urlencoded";
  11. request.ContentLength = byteArray.Length;
  12. Stream dataStream = request.GetRequestStream();
  13. dataStream.Write(byteArray, 0, byteArray.Length);
  14. dataStream.Close();
  15.  
  16. WebResponse response = request.GetResponse();
  17. dataStream = response.GetResponseStream();
  18. StreamReader reader = new StreamReader(dataStream);
  19. string responseFromServer = reader.ReadToEnd();
  20. response.Wtrite(responseFromServer);
Aug 19 '10 #1
0 837

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: vishal | last post by:
hello friends i have one php script which generates html page containing form. what i want is submit this form using php script. pls give me some idea that how can i submit form using php...
3
by: Mark Michel | last post by:
Hi. I have made an html form which I would like to send by e-mail. When the recipient receives the e-mail form, I would like them to be able to fill it out and click the Submit button which will...
2
by: Terence Parker | last post by:
How does one go about submitting a form with a link - but submitting it to a new window AND to a page different to that described within the action="" option of the <form> tag? Say, for example,...
3
by: Ori | last post by:
Hi! This is my problem... I have two frames. one which is my website (top frame), and the other is someone else website. I want to simulate a submit in the other website (lower frame)when a...
6
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
6
by: tencip | last post by:
Hi everyone, So, i've got a form that is very simple. It hold three elements: username, password, and domain. The goal here is to have the form submit the login to an administrative section...
4
by: karenmiddleol | last post by:
I have a simple form to accept two form fields and display the values entered on pressing the submit button. The following is the form I have created to accept the two entries and display the form...
6
by: nikou_70 | last post by:
I have a page with image, image has some image map, I want to submit form when user mouseover that image map, my code is like this: <img src="Images/floor4.jpg"usemap="#planetmap" id="IMG1">...
1
by: rwelchman | last post by:
Hi, I have a problem with a submit form in that it does not submit(error message), I think because there is another form on the page whose action is to work out various inputted variables and give...
1
by: arggg | last post by:
I created a submit form that calls a javascript:AjAX Command that will call the data and submit it without have the page refresh. This works perfect in Firefox however in IE and Opera when the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.