![](/img/trans.png)
[英]How to make the button_Click event opens the page in a pop-up window in ASP.NET?
[英]Upon Button Click Display Pop-Up for Certain Time and then Redirect Page - ASP.NET
我有一個表格。 單擊提交按鈕后,我想顯示一條消息(例如:“”已成功提交)作為彈出窗口。 彈出窗口必須停留約3秒鍾,之后我要重新加載/重定向頁面。
我知道我可以使用jQuery實現此目的。 但是我想知道是否有一種方法可以通過asp.net/C#來實現,我可以在aspx頁面的cs文件中編寫它。
我該如何實現?
下面是我當前編寫的按鈕單擊方法。 注意代碼: thread.sleep(3000)
-在這3秒的延遲中,我想顯示一個彈出窗口。
protected void btnSubmit_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("insert into Demo_UserInfo values (@UserID, 'FX1234', (select ReleaseID from Demo_ReleaseInfo where ProductName='asd'), 0)", con);
cmd.Parameters.AddWithValue("@UserID", txtUserID.Text);
cmd.ExecuteNonQuery();
con.Close();
Thread.Sleep(3000);
Response.Redirect("~/Admin/MapReleaseItem.aspx");
}
您可以改用裝載機本文可以為您提供幫助
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.