Hello,

I want to give alert on click of button my codes is

Protected Sub BTN_SAVE_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTN_SAVE.Click

        Response.Write("<script>alert('hello')</script>")
End Sub

But after clicking it is giving alert message. why?


Alok Shrivastava

Recommended Answers

All 3 Replies

>But after clicking it is giving alert message. why?

JavaScript code will is executed when the result of requested page returned to the web-browser..

its supposed to be

Response.Write("<script>alert('hello');</script>")

Hello all,
sorry actually I want to say "But after clicking it is NOT giving alert message. why?"


and


I have changed my codes to "alert('hello');" but problem is same.


Alok Shhrivastava

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.