views:

29

answers:

1

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.

+2  A: 

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

Neil Aitken