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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

submit form to another page

Status
Not open for further replies.

wrbodine

Programmer
Aug 24, 2000
302
0
0
US
Hi,

I'm new to Asp.net, and have a button being clicked that should be submitting a form on the .aspx page.

The button code (in page DepositAccount.aspx) is the following:
<input type=&quot;submit&quot; class=&quot;fwdButton&quot; value=&quot;Apply Now&quot; id=Submit1 name=Submit1 runat=&quot;server&quot;>

this is in a form with the following tag:
<form id=&quot;acctApp&quot; action=&quot;Confirmation.aspx&quot; method=&quot;post&quot;>

When clicked on, the form posts to itself; However, I need to go to Confirmation.aspx, and get some variables there using the post method. What am I missing here? Is there a way to run code in a function on the 1st page (calling our business logic component, etc, and then still post to the other page? Or do I just need to change syntax?

Thanks, [sunshine]
Ray
 
Why go to another page to process data? It's more of a &quot;classic&quot; ASP techinique. Use an event handler for click event of your button in page code behind to set/get your variables, etc. There is a bunch of samples out here, including in .Net help.
 
As the LV says you should use the code-behind technique to process any server side stuff.

However if you still want to go to a different page anyway you can use server.transer, server.execute or response.redirect.

Check out the help for these functions.

If you really have to use classic asp style posting to another form - you will need to write it using non &quot;runat='server'&quot; controls - then the action property will work.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top