KMurray
KMurray

Reputation: 79

Javascript Alert message showing twice

I have a program that on button click pops an alert message. Whenever the message pops up and I click OK, the message pops up again. Does anyone know why this might be happening? Here is my code:

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

Thanks in advance for your responses.

Upvotes: 1

Views: 369

Answers (1)

Pratik Gupta
Pratik Gupta

Reputation: 77

Did you try:

Dim myScript As String = "window.alert('There is a problem');"
ClientScript.RegisterStartupScript(Me.GetType(), "myScript", myScript, True)

Upvotes: 1

Related Questions