Objective: POST data to a remote website and follow the 302 redirect response
Synopsis: This works quite well in plain ASP.NET. I can POST to the remote site either using the asp form's action attribute or a button and it's PostBackUrl property. However as soon as I try to accomplish the same behavior inside a Sharepoint
page it causes a lot of trouble.
Scenario 1 (changing the form's action attribute - less preferred):
Imagine this simple publishing aspx page (for what it's worth I encountered the exact same behavior using an application page).
<input type="text" name="myField1" value="abc" />
<input type="text" name="myField2" value="abcdef" />
<input type="text" name="myField3" value="123" />
<input type="submit" value="submit now" />
Note that I need to use pure html controls because the remote site expects pre-defined names for these fields. And as we all know control naming is something we cannot really influence up to .NET framework 3.5SP1 (4.0 is supposed to help, right?).
Anyway we still need to set the action attribute of the form. This is being done in the page's OnLoad() method.
Result: The aspform is being posted to the remote site, the remote site responds with 302 and the browser redirects to the returned ur
View Complete Post