alert message box return blank page
-
hi, i have a problem, why is it that the alert message returning a blank page behind. here is my function;
Public Sub Alert(ByVal argMessage As String)
sb = New StringBuilder
sb.Append("<script>")
sb.Append("alert('")
sb.Append(argMessage)
sb.Append("');")
sb.Append("</script>")
Page.ClientScript.RegisterStartupScript(Me.GetType(), "Message", sb.ToString())
-- I've tried to change this into RegisterClientScriptBlock , but its the same result.
End SubProtected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
.... my query here..... If ds.Tables(0).Rows.Count = 0 Then Me.Alert("No data found.pease search again.") Return --> ' i tried to remove this, but its the same result. End If
End Sub
C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」
-
hi, i have a problem, why is it that the alert message returning a blank page behind. here is my function;
Public Sub Alert(ByVal argMessage As String)
sb = New StringBuilder
sb.Append("<script>")
sb.Append("alert('")
sb.Append(argMessage)
sb.Append("');")
sb.Append("</script>")
Page.ClientScript.RegisterStartupScript(Me.GetType(), "Message", sb.ToString())
-- I've tried to change this into RegisterClientScriptBlock , but its the same result.
End SubProtected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
.... my query here..... If ds.Tables(0).Rows.Count = 0 Then Me.Alert("No data found.pease search again.") Return --> ' i tried to remove this, but its the same result. End If
End Sub
C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」
I have tried with your code and it is working fine. What exact problem you are facing? Try to put a breakpoint and debug it.