Invoking a pop-up 'confirm' message box in ASP.NET
<p>I know how to this when a button is clicked. For example:</p>

<pre><code>imgBtnDelete.Attributes.Add("onclick", "return confirm('Please confirm you want to delete the letter')")
</code></pre>

<p>My question is:</p>

<p>Say I have a piece of code-behind not related to clicking,calculating the value of a boolean, and if the boolean is true then I want the message box with ok/cancel to appear.</p>

<p>f.e.:</p>

<pre><code>bool hasMoney = ...

if (hasMoney)
{
\\message box..
}
</code></pre>

<p>How do I do it?</p>
