ASP.NET website - changing the value entered in a form before submitting
<p>I have a form in a .aspx file in a Visual Studio project. I have a variable that I want to change the value of before the user hits the submit button. I cannot figure out how to do this in Visual Studio. I am new to Visual Studio and when I am developing for Android, it is easy: just make the changes in the OnClick method.</p>

<p>I created a function in the code behind and I have that as the event handler for the submit button. The problem is, when the submit button redirects, the value is unchanged.</p>

<p>Field:</p>

<pre><code>&lt;input type=hidden name="AMOUNT" value="&lt;%=amount%&gt;"&gt;
</code></pre>

<p>Submit button:</p>

<pre><code>&lt;asp:Button ID="btnComplete" type="submit" runat="server" Text="Submit" OnClick="Submitted" /&gt;
</code></pre>

<p>Submitted function:</p>

<pre><code>protected void Submitted(Object sender, EventArgs e)
{
    amount += 1;
}
</code></pre>

<p>The "amount" variable is 100 and is displayed as 100 on the next page instead of 101.</p>