Posting ASP .Net web form to another asp page

  • Thread starter Thread starter Newbie
  • Start date Start date
N

Newbie

Hi,

I need help in posting asp .net application web form to another asp based
web app.

I have seen many examples using HttpWebRequest class but the problem is I do
not want the request back but want to post the data to another form so that
at the asp page level we can use request.form values.

Any leads would definately be appreciated.

thanks

Ab
 
You can't post to a different page in ASP.NET, this is the built-in
architecture. What you can do is use Server.Transfer(newPage.aspx), which
will transfer control to the new page specified as well as the request
object, so data in the request object will be available on the new page.
 
<form id="programmaticID"
method=POST | GET
action="srcpageURL"
runat="server" >
Other controls, input forms, and so on.
</form>
 
In .NET you can set the form's action to whatever you like, it won't post to
that page. Server forms submit to themselves, no matter what. This is the
fundamental architecture of ASP.NET and the basis for PostBack & ViewState.
 
Just skip the ASP.NET's post-back mechanism.
Using the traditional Querystring way.
On the submit button onclick event, build the querystring
<script language="javascript" for="button1" event="onclick">
{
var strQuery = "targetURL.asp?Field1=" + Field1.value + "&Field2=" + Field2.value;
window.navigate(strQuery);
}
</script>

Bin
MCP
 
Back
Top