How to control action parameter in the <form> tag

Discussion in 'ASP.NET / ASP.NET Core' started by rrvolk17306, Nov 30, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. 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 ?
     
  2. 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
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page