我有一个程序,按下按钮会弹出警告消息。每当弹出消息并单击“确定”时,该消息将再次弹出。有谁知道为什么会发生这种情况?这是我的代码:
If MyDataTable.Rows.Count = 0 Then
Response.Write("<script language=""javascript"">alert('Order # does not exist!');</script>")
Else
Response.Write("<script language=""javascript"">alert('Order updated!');</script>")
OrderTextEditor.Text = ""
TypeTextEditor.Text = ""
End If
提前感谢您的回复。
答案 0 :(得分:1)
你有没有尝试过:
Dim myScript As String = "window.alert('There is a problem');"
ClientScript.RegisterStartupScript(Me.GetType(), "myScript", myScript, True)