How to load the webpage into WebBrowser control

0
0

Hi there,
please advise how to load the document at the specified URL into the WebBrowser control.
The Url() method only set the URL but doesn’t load the webpage. I’m missing the Navigate() method
on the control.

Best regards

Artur

  • You must to post comments
0
0

Hi Eric,

v=1 will be cached by the browser as well. Can you please try changing your code to append a timestamp instead of 1 ?

refresh

Hope that helps.

Best regards
Frank

Attachment
  • Frank (ITG)
    Additionally the Update() calls are not needed here. Update marks the component as “dirty” so that Wisej sends back the differences to the client. Setting the built-in properties (like Url in that case) already calls Update() internally. Calling it multiple times is not really a problem since it´s ignored if the component is already included in the “dirty” list – but it´s not necessary in your app´s code. It should be used in custom property setters or methods if they require a client update. Best regards, Frank
  • Eric Mathay
    Hi Frank, That does the Trick :), It works great now. Thanks for clarifying the usage of the update(). Those update were added due to all the sorts of efforts trying to get the controls properly refreshing.
  • You must to post comments
0
0

Hi Luca,

Here is a sample App to reproduce the problem. The whole app is currently setup to run by showing html files stored in C:\temp.

I have created an IIS App “CTemp”, which allows to have the files exposed as http://localhost/CTemp/….

All is configurable through Settings parameters.

There is a TabControl with the different Wisej Web Controls. The HTMLPanel is properly following changes made to a file. To me it’s because the htmlPanel accepts a file path. All the others controls requiring a URL aren’t synched after changes to a document.

Here doing multiple edits isn’t working properly,pressing F5 after an edit is clearing the problem. It must be cache related.

I can’t understand why I can’t refresh the same way by code as by pressing F5.

To be sure it isn’t IIS related, I checjed in the HTTP Response Headers : “Expire Web content : immediately”.

After having done an edit through the program, when I visit the URL of the edit (http://localhost/CTemp/TEST.html?v=1) through a browser, it shows the changes.

Would you be so kind to give it a try ?

Thanks and Happy New Year to the whole team.

Attachment
  • You must to post comments
0
0

That’s probably caused by the browser’s security. Wisej should handle the error though: will add a bug for this.

In  general, many sites don’t allow their content to be loaded in an iframe. All browsers don’t allow javascript to access the document in the iframe when it’s from a different origin. You can try some samples here: http://www.qooxdoo.org/current/demobrowser/#showcase~Browser.html

HTH

Best,

Luca

  • You must to post comments
0
0

Hi Luca,

thank you for your reply. Using 1.3.16 and get following error messages in the IFramePanel control:

  1. 0x800a138f – JavaScript runtime error: Unable to get property ‘body’ of undefined or null reference.
  2. 0x80070005 – JavaScript runtime error: Access is denied.

Best regards

  • You must to post comments
0
0

Hi Thomas,

The WebBrowser control is not implemented yet. Use the IFramePanel for now, it’s basically the same.

Best,

Luca

  • Eric Mathay
    Hello, I did some tests with all the HTML related controls (AspNetPanel,htmlPanel,IframePanel,WebBrowser). The test was to load a simple HTML file served by IIS. The Application page has a button to assign the served file to the control (URL, Htmlsource,… depending of the control) Changing the served file content was the test objective. From what I have experimented, the controls are able to properly load the HTML file served, but only the first time. After first assignment, If the file is changed outside of the Application (straight editing it on the Server), the controls can’t reload it. No error message is shown. Seems to be some kind of caching problem, or pointer. If the Application page is refreshed, the reload is possible with the changed content. May be this helps you fix it.
  • Luca (ITG)
    There is no active monitoring of the file, if it’s changed you have to refresh the control showing the file. I tried to call htmlPanel1.Update() after editing the displayed html file and it updated the displayed content. There is specific code in the HtmlPanel not to cache the html text. For the IFramePanel it’s different since you are passing a URL and loading or reloading is up to the browser. In this case you can simply add a cache buster argument, like ?v={timestamp}.
  • Eric Mathay
    Hello Luca, Unfortunately I can’t succeed. I tried with calling the update, appending ?v=1, calling invalidate, … To let you test, I have made a small app, which I will append here.
  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.