Click here to Skip to main content
15,919,132 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone!

i get a trouble when i try to get data from a web page by WebBrowser control. i can get the web page by IE without error, but it occurs a error box when i use WebBrowser1.Navigate.
i have to navigate many pages to get the data page by page, how can i suppress the error box in .net 3.5?
(1) i tried "broswer.ScriptErrorsSuppressed = True",it not works.
(2) i tried such code ,it not works too.

VB
Imports SHDocVw
Public Class EWebBrowser
    Inherits System.Windows.Forms.WebBrowser
    Private Iwb2 As SHDocVw.IWebBrowser2

    Protected Overloads Overrides Sub AttachInterfaces(ByVal nativeActiveXObject As Object)
        Iwb2 = DirectCast(nativeActiveXObject, SHDocVw.IWebBrowser2)
        Iwb2.Silent = True
        MyBase.AttachInterfaces(nativeActiveXObject)
    End Sub

    Protected Overloads Overrides Sub DetachInterfaces()
        Iwb2 = Nothing
        MyBase.DetachInterfaces()
    End Sub
End Class


Help me please, any answer is appreciated!
Posted
Updated 11-Jul-10 19:50pm
v3
Comments
[no name] 11-Jul-10 23:04pm    
What error are you getting?

1 solution

In WPF I used this technique.

Disabling javascript errors in WPF WebBRowser control


Maybe it can help you.

alk.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900