asp.net下载和弹出提示框的问题
先看代码;
Page.RegisterStartupScript("","<script>alert('您的帐户被扣除了" + this.lblmoney.Text.ToString() + "元')</script>");
int fileupdatexiazaiID = Convert.ToInt32(Request.QueryString["id"].ToString());
int uid = int.Parse(Session["userid"].ToString());
int kejianid = fileupdatexiazaiID;
float fuM = float.Parse(this.lblmoney.Text.Trim());
int t = db.SaveInforAssinRY(uid, kejianid, fuM);
if (t != 1)
{
Page.RegisterStartupScript("test", "<script>alert('对不起,下载失败!')</script>");
}
else
{
//下载并修改下载次数
string sql = "update EduWare set downloadCount=downloadCount+1 where ID=" + fileupdatexiazaiID + "";
int x = db.ExecuteInsert(sql);
if (x > 0)
{
string Pathxia = Server.MapPath("../" + Session["zuozhe"] + "/Courseware/");
string fileName = HttpContext.Current.Server.UrlEncode(filenames1);
string filePath = Pathxia + filenames1;
//使用TransmifFile下载文件
FileInfo info = new FileInfo(filePath);
long fileSize = info.Length;
Response.Clear();
Response.ContentType = "application/x-zip-compressed";
Response.AddHeader("Content-Disposition", "attachment;filename=" + filenames1);
//不指明Content-Length用Flush的话不会显示下载进度
Response.AddHeader("Content-Length", fileSize.ToString());
Response.TransmitFile(filePath);
Response.End();
Response.Flush();
Response.Close();
大家看到第一行的弹出框了吗?我想让他弹出提示框后在执行下载,可为什么他不弹出框,就直接下载了! 请高手帮忙。谢谢