public void FireEventAsync(string eventName, NameValueCollection eventProperties) { StringBuilder scriptCode = UtilityClass.CreateJavaScriptFireEventCode(eventProperties, DispHtmlBaseElement, eventName); IHTMLWindow2 window = ((IHTMLDocument2)DispHtmlBaseElement.document).parentWindow; AsyncScriptRunner asyncScriptRunner = new AsyncScriptRunner(scriptCode.ToString(), window); UtilityClass.AsyncActionOnBrowser(new ThreadStart(asyncScriptRunner.FireEvent)); }