这是我的代码:
string result = BackUp.BackupDatabase(folder, fileName);
if (result == "Complete")
{
BackupSuccessfullyLbl.Text = "BackUp created successfully.";
BackupSuccessfullyPnl.Visible = true;
if (BackUpPlaceRBL.SelectedIndex == 1)
{
var file = new System.IO.FileInfo(folder + fileName);
Response.AppendHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AppendHeader("Content-Length", file.Length.ToString());
Response.TransmitFile(file.FullName);
}
}
默认情况下,“”的“可见”BackupSuccessfullyPnl
为假。
我已经从我的数据库创建了一个备份,然后我显示了成功的消息。
我想下载创建的文件,if BackUpPlaceRBL.SelectedIndex == 1.
当 时BackUpPlaceRBL.SelectedIndex != 1
,“ BackupSuccessfullyPnl
”完美显示。但是当文件被下载时,面板是不可见的。怎么了?