title: CSRF fix in aspx page
body: <p>I need the fix for CSRF flaw for aspx page. The code is like this -</p>
  
  <p>ASPX -</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;asp:Content runat='server'&gt;
  &lt;asp:Panel runat='server'&gt;
  &lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;Username&lt;/td&gt;
      &lt;td&gt;&lt;asp:TextBox runat="server" ID="Username" autocomplete="off"&gt;&lt;/asp:TextBox&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Password&lt;/td&gt;
      &lt;td&gt;&lt;asp:TextBox runat="server" ID="Password" TextMode="Password" autocomplete="off"&gt;&lt;/asp:TextBox&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;asp:Button ID="Submit" runat="server" Text="Submit"
                              OnClick="SubmitButton_Click" CssClass="Resizable" /&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/asp:Panel&gt;
  &lt;/asp:Content&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>ASPX.cs -</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>protected void SubmitButton_Click(object sender, EventArgs e)
          {
            //Code here
          }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now while inserting &lt;%@ Html.AntiForgeryToken() %> at the top throws error "The server block is not well formed". So how should I proceed with the fix.</p>