title: submitting a programatically change form action from within updatepanel
body: <p>I'm confused... I have a form on my aspx page which the text fields sit inside an update panel. I use this to validate a login. If the login is successful, I change the form action and I want the form to then submit to that url. </p>
  
  <pre><code>&lt;form runat="server" id="form1"&gt;
       &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;&lt;/asp:ScriptManager&gt;
       &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
            &lt;ContentTemplate&gt;
                 &lt;!--form fields--&gt;
                 &lt;asp:Button ID="btnSubmit" runat="server"  onclick="btnSubmit_click" Text="Continue" /&gt;
            &lt;/ContentTemplate&gt;
       &lt;/asp:UpdatePanel&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Then my codebehind</p>
  
  <pre><code> protected void btnSubmit_click(object sender, EventArgs e)
   {
        //do some validation, if ok then change the form action
        form1.Action = "myurl2.aspx";
        btnSubmit = "proceed to next url";
   }
  </code></pre>
  
  <p>So once the user has been validated, I change the URL of the form to post to, then change the button name. When I then click the submit button nothing happens. How can I submit the form? I tried doing something like form1.submit but obviously that doesn't exist!</p>