How to track user response to confirm box, generated at runtime from c# code?
<p>I am trying to get user confirmation from c# code behind file, to confirm if user wants to overwrite the existing file on server of cancel the operation but so far no luck.</p>

<p>this is my code :</p>

<pre><code>if (File.Exists(filePath))
{
   string alertMsg = @"confirm('A File already exists with the same name. \n Would you like to overwrite the existing file ?');";
   ScriptManager.RegisterStartupScript(this, this.GetType(), "Test", alertMsg, true);
}
else
{
   fuPSD.SaveAs(filePath);
}
</code></pre>

<p>any help would be highly appreciated.</p>
