C# - Using a copy of Session-stored variables instead of reference
<p>I have an asp:ImageButton with OnClick="Btn_OnClick".<br>
In Btn_OnClick I have this line:  </p>

<pre><code>DataTable dtTable = (DataTable)Session["someSessionKey"]
</code></pre>

<p>and dtTable is altered in the function.</p>

<p>I've noticed that if the button's clicked more than once, the dtTable I take from the session contains the altered table, probably meaning dtTable is not a copy but a reference of the session variable.</p>

<p>How can I alter a copy of Session["someSessionKey"], and not the actual value?<br>
  Thanks!</p>
