473,394 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

onerror event axWebrowser

Hello. I need a little help to get this thing finished. Im trying to catch
js errors and the event works as expected. However I have created an event
from doc.parentWindow but when it fires im unable to suppress it using a
returnValue = true.

Im navigating to an URI using axWebBrowser1.Navigate(txtURI.Text, ref
nullObject, ref nullObjStr, ref nullObjStr, ref nullObjStr);

My code:
mshtml.CEventObj CEobj;
mshtml.HTMLWindowEvents2_Event iEvent2;
private void NavigateComplete(object sender,
AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Even t e)

{
mshtml.HTMLDocument doc;
doc = (mshtml.HTMLDocument)axWebBrowser1.Document;
iEvent2 = (mshtml.HTMLWindowEvents2_Event) doc.parentWindow;
iEvent2.onerror += new
mshtml.HTMLWindowEvents2_onerrorEventHandler(iEven t2_onerror);
}

When this iEvent2 fires:

private void iEvent2_onerror(string description, string url, int line)
{
label1.Text = "Err";
CEobj = (mshtml.CEventObj)iEvent2 ;
CEobj.returnValue = true;
}

As you can see im trying to set the returnValue = true but it stills opens a
new window telling me that there's an error onm the page. How do I suppress
that?

I've read that returnValue = true should do it here:
http://support.microsoft.com/?kbid=279535

Kind regards


Nov 16 '05 #1
0 1159

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bjarthur | last post by:
i have (see below) what i think is a fairly simple algorithm, but yet it doesn't work. given a directory with consecutively numbered jpeg files (1.jpg, 2.jpg, 3.jpg...), it is designed to count...
2
by: Tee | last post by:
what's the differences between "Overrides Sub OnError" and "Sub Page_Error" ?
2
by: Supra | last post by:
when using axwebrowser, then type www.penthouse.com and i got error when url came on. the error is: Your current security setting probhit running ActiveX controls on this page. As a result, the...
3
by: Tobius | last post by:
I want to be able to define a custom onerror event that detects an attempt to call a known function and load a file if it's not already loaded and re-call the function. The only problem is that any...
2
by: Water Cooler v2 | last post by:
onerror event is tied to: 1. the page 2. one per script tag 3. can have cascades of one per control if 3 is true, what are the controls that implement it? PS: I agree that...
0
by: JR | last post by:
I am opening a html page using showModalDialog. To the page's onError event, i am attaching custom event handler. When ever any exception occures, onError event is firing 2 times. I found the same...
2
by: sid | last post by:
I am writing a webpage that loads another frame. I have written a routine to trap the "OnLoad" event and test to see if the page I wanted to be loaded was what was loaded. But, that only works...
3
Plater
by: Plater | last post by:
I am using the onerror event for the image tag in an attempt to save overhead for my server (which will be on a microprocessor) Basicly it tries to load the images from a real server on the...
4
by: josh | last post by:
Hi if I try to attach onerror event via addEventListener window.addEventListener("error", myError, false) it does not work as it pass to myError only the event object but not the three...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.