title: How to change the form action in C# .NET through code?
body: <p>I am working on a project in C# .NET that allows me only one form in the .aspx file.</p>
  
  <pre><code>&lt;form id="form1" runat="server" action="#1"&gt;
  </code></pre>
  
  <p>How can I change the form action through the C# code in a method? 
  I have tried this:</p>
  
  <pre><code>protected void Button1_Click(object sender, EventArgs e)
  {
      form1.Action = "#2";
  }
  </code></pre>
  
  <p>but it didn't work. Thanks in advance...</p>