Implementing Calculator History
<p>The following code is a fully functioning ASP.NET calculator. How can I keep the history of all calculations entered even if the user closes the browser?  For example, if the user enters 5+10, I need it to show 15 after I close and open the program again.  </p>

<p>Also, is there a way to display the history of all calculations over the last 10 minutes? </p>

<pre><code>&lt;script runat="server"&gt;

sub getvalue0(s as Object, e as EventArgs)

txtinput.Text=txtinput.Text &amp; btn0.Text

end sub



sub getvalue1(s as Object, e as EventArgs)

txtinput.Text=txtinput.Text &amp; btn1.Text

end sub



sub getvalue2(s as Object, e as EventArgs)

txtinput.Text=txtinput.Text &amp; btn2.Text

end sub



sub getvalue3(s as Object, e as EventArgs)

txtinput.Text=txtinput.Text &amp; btn3.Text

end sub



sub getvalue4(s as Object, e as EventArgs)

txtinput.Text=txtinput.Text &amp; btn4.Text

end sub



sub getvalue5(s as Object, e as EventArgs)

txtinput.Text=txtinput.Text &amp; btn5.Text

end sub



sub getvalue6(s as Object, e as EventArgs)

txtinput.Text=txtinput.Text &amp; btn6.Text

end sub



sub getvalue7(s as Object, e as EventArgs)

txtinput.Text=txtinput.Text &amp; btn7.Text

end sub



sub getvalue8(s as Object, e as EventArgs)

txtinput.Text=txtinput.Text &amp; btn8.Text

end sub



sub getvalue9(s as Object, e as EventArgs)

txtinput.Text=txtinput.Text &amp; btn9.Text

end sub



sub check(s as Object, e as EventArgs)

val1.Text=txtinput.Text

txtinput.Text=""

end sub



sub sum(s as Object, E as EventArgs)

val2.Text=txtinput.Text

dim result=cInt(val1.Text)+cInt(val2.Text)

txtinput.Text=result

end sub



sub clear(s as Object, e as EventArgs)

txtinput.Text=""

val1.Text=""

val2.Text=""

end sub



&lt;/script&gt;



&lt;html&gt;

&lt;title&gt; Basic Calculator&lt;/title&gt;

&lt;body&gt;



&lt;form id="Form1" runat="server"&gt;

&lt;h1&gt;Basic Calculator&lt;/h1&gt;

&lt;asp:TextBox id="txtinput" runat="server" /&gt;

&lt;table style="background:#00ffff"&gt;

&lt;tr&gt;

&lt;td&gt;&lt;asp:Button id="btn0" Text="0" runat="server" OnClick="getvalue0" /&gt;&lt;/rd&gt;

&lt;td&gt;&lt;asp:Button id="btn1" Text="1" runat="server" OnClick="getvalue1" /&gt;&lt;/rd&gt;

&lt;td&gt;&lt;asp:Button id="btn2" Text="2" runat="server" OnClick="getvalue2"/&gt;&lt;/rd&gt;



&lt;td&gt;&lt;asp:Button id="btnsum" Text="+" runat="server" OnClick="check"/&gt;&lt;/rd&gt;

&lt;/tr&gt;

&lt;td&gt;&lt;asp:Button id="btn3" Text="3" runat="server" OnClick="getvalue3" /&gt;&lt;/rd&gt;

&lt;td&gt;&lt;asp:Button id="btn4" Text="4" runat="server" OnClick="getvalue4"/&gt;&lt;/rd&gt;

&lt;td&gt;&lt;asp:Button id="btn5" Text="5" runat="server" OnClick="getvalue5"/&gt;&lt;/rd&gt;



&lt;td&gt;&lt;asp:Button id="btnequal" Text="=" runat="server" OnClick="sum" /&gt;&lt;/rd&gt;

&lt;/tr&gt;

&lt;td&gt;&lt;asp:Button id="btn6" Text="6" runat="server" OnClick="getvalue6"/&gt;&lt;/rd&gt;

&lt;td&gt;&lt;asp:Button id="btn7" Text="7" runat="server" OnClick="getvalue7"/&gt;&lt;/rd&gt;

&lt;td&gt;&lt;asp:Button id="btn8" Text="8" runat="server" OnClick="getvalue8"/&gt;&lt;/rd&gt;



&lt;td&gt;&lt;asp:Button id="btnclear" Text="Clear" runat="server" OnClick="clear"/&gt;&lt;/rd&gt;

&lt;/tr&gt;

&lt;tr&gt;&lt;td&gt;&lt;asp:Button id="btn9" Text="9" runat="server" OnClick="getvalue9"/&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;

&lt;asp:Textbox id="val1" Visible="false" runat="server"/&gt;

&lt;asp:Textbox id="val2" visible="false" runat="server"/&gt;



&lt;/form&gt;

&lt;/body&gt;

&lt;/html&gt;
</code></pre>
