下面是我在 C# 中的部分代码,它假设发送电子邮件,显示 msg 框,然后直接到“Multihotelbook.aspx”页面,但直接到页面而不显示 msgbox。我不知道为什么。需要帮忙
emailClient.Send(消息);
// Response.Write("<script>window.alert('Email sent')</script>");
//ClientScript.RegisterStartupScript(typeof(Page), "myscript", "<script>alert('Email sent');</script>");
// System.Windows.Forms.MessageBox.Show("Email sent");
// MessageBox.Show("Email sent");
// MessageBoxResult result = MessageBox.Show("Email sent", "Confirmation");
//ClientScript.RegisterStartupScript(typeof(Page), "myscript", "<script>alert('Email sent');</script>");
//ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "confirm('Email sent');", true);
//ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "KEY", "alert('Email sent')", true);
Page.ClientScript.RegisterStartupScript(typeof(string), "alert", "<script>alert('Email sent')</script>");
Response.Redirect("Multihotelbook.aspx");