PDA

View Full Version : How to control action parameter in the <form> tag


rrvolk17306
11-30-2004, 03:00 AM
I have a web form (WebForm1.aspx), which pulls in a user control.

The user control has a <form id="Form1" action="page2.aspx" method="post" runat="server"> tag.

The problem, is that the action="page2.aspx" is always replaced with the address (WebForm1.aspx)!

Is there a way to remedy this ?

Michael
12-09-2004, 10:18 AM
Yep,


an aspx page is defined by the fact it will post back to itself, that is how your Server side events actually work in the first place, if it does not postback a server side event will never fire such as a Button Click on any other event.


you can use a classic asp page in an .Net project if you want to, however I think want you are trying to achieve is something like the below;


On ASPX page place Button of some sort


On Serverside OnClick for this button use a Server.Transfer or Response.Redirect post to the new page, you can put as many arguments on redirect as you normally would.


Michael