ユーザーがサーバー上の既存のファイルを上書きして操作をキャンセルするかどうかを確認するために、C# のコード ビハインド ファイルからユーザーの確認を取得しようとしていますが、これまでのところうまくいきません。
これは私のコードです:
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);
}
どんな助けでも大歓迎です。