samedi 25 avril 2015

WebBrowser iframe not displays when using HttpWebRequest


I use Winform WebBrowser to load an website. The website is contains an iframe. The URL here: http://ift.tt/1v05tFk

When i use Navigate() method to load that URL. The WebBrowser display an texteditor and an iframe.

When i try to use HttpWebRequest to load the website, like this:

    HttpWebRequest myRequest = (HttpWebRequest)HttpWebRequest.Create("http://ift.tt/1v05tFk");

    HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();

    webBrowser1.DocumentStream = myResponse.GetResponseStream();

The WebBrowser is also display an html's texteditor, but the iframe is not displayed. It just show me the iframe's URL. enter image description here Why the WebBrowser not display the iframe contents ? While the HTML,CSS,JS still work, but the Iframe not ?


Aucun commentaire:

Enregistrer un commentaire