Include form info in Response.Redirect

  • Thread starter Thread starter Stephan Bour
  • Start date Start date
S

Stephan Bour

I have a vexing problem I hope someone can help me with:
I have an ASP.Net site that allows users to place orders for biological
materials. Once the order is done though, I would like to have two pieces of
information automatically entered into textfields on a form managed by a
different site on a different server.
I can do a Response.Redirect to the other site no problem and load the blank
form page. My question is whether I can have the two text boxes on that
blank form automatically filled up with some data contained in a datagrid on
my side. The outside form has a <textarea name="sequenceData" cols="45"
rows="8"></textarea></td> for example. Can I pass a string in the
Response.Redirect method and target it to that textarea?
Thanks,
Stephan.
 
I have found another simple solution that works perfectly.
ASP.Net provides a WebClient object that allows the server to behave like a
client to another web server. All I had to do was to include the ID of the
remote form's Text boxes (sequenceData and sequenceName below). One can even
retrieve the stream back from the remote form and perform checks for success
of failure, depending on what is returned.

public bool AddToRemote (LocalMethodReturningProperties method) {

WebClient myWebClient = new WebClient();
String URL =
"http://128.231.000.00/RemoteFormSubmitButton?sequenceName=" +
method.Parameter1 + "&sequenceData=" + method.Parameter2;
Stream myStream = myWebClient.OpenRead(URL);

StreamReader sr = new StreamReader(myStream);
Response.Write("\nResponse received was :\n\n" + sr.ReadToEnd());

}
 
Back
Top