Take the 2-minute tour ×

I'm working on a web application, which in some times JS messages and alerts popup, I want to suppress this messages and alerts from poping up, How can I do that if I don't know when or where this message pop up from using c# code?!

in other words, how I can take control on the IE window(client side) in which this message popup and how to simulate a click event on the "OK" button in that message.

Hope you got it !

please help me because I'm runnig out of time.

share|improve this question

1 Answer 1

You can actually overide the standard alert function with a custom one in javascript

window.alert = function(message) {
   // process or swallow the message

See this for more details

share|improve this answer

Your Answer


