Skip to content Skip to sidebar Skip to footer

Object Doesn't Support Property Or Method Webbrowser Control

I have developed a mobile app (in asp.net) and I am using a WinForms application with the WebBrowser control to demo it. I my main page I am using a script to hide the address bar:

Solution 1:

I know that this problem is from 2012 but there is an answer for it.

At the top of the <head> document where script is added you need to write

<metahttp-equiv="X-UA-Compatible"content="IE=edge">

WinForms WebBrowser control is using Internet Explorer but you need to force the latest version there. For eg. if you are using jQuery 2+ it requires IE 9+ so you need to use at least version 9 or later.

Solution 2:

Webbrowser control doesn't suppert jquery v2.

Use the jquery 1.9.1.

<scriptsrc="http://code.jquery.com/jquery-1.9.1.js"></script>

Solution 3:

The Webbrowser control is a part of the Internet Explorer itself. And Internet Explorer doesnt support the window.addEventListener method. Use window.attachEvent method instead.

So the script in your page will read like

window.attachEvent("load", function () {
    // Set a timeout...setTimeout(function () {
        // Hide the address bar!window.scrollTo(0, 1);
    }, 0);
});

Hope this would help you!

Post a Comment for "Object Doesn't Support Property Or Method Webbrowser Control"