This is a migrated thread and some comments may be shown as answers.

RadWindow opens slowly when running inside WebBrowser (WinForms) control

3 Answers 239 Views
Window
This is a migrated thread and some comments may be shown as answers.
Verner Lundsteen
Top achievements
Rank 1
Verner Lundsteen asked on 24 Mar 2017, 01:23 PM

I have a WinForms "host" application, that contains a WebBrowser control: https://msdn.microsoft.com/en-us/library/w290k23d(v=vs.110).aspx

In this WebBrowser control I run a Web application built using "Telerik UI for ASP.NET AJAX". This works fine most of the time.

Problem occurs, when the Web application opens a RadWindow, and this RadWindow displays a WebForm from my application. Most of the time it takes 3-6 seconds from the user clicks the button to open the window until the window is displayed - and sometimes it takes addtitionally 3-5 seconds, until page inside RadWindow is loaded. The WebForm inside the RadWindow is very simple - it normally takes a fraction of a second to open.

No problem when the WebForm is opened in a popup window (using window.open) instead of inside RadWindow.

No problem when using WebDev (the development web server that comes with Visual Studio) - problem "only" occurs when the web application runs under IIS.

I turned on Fiddler to see what happened. When I start "Capture" in Fiddler, my problem goes away (when running against local IIS - running Fiddler did not make any difference when running against an IIS on a remote machine). Maybe my problem is related to the discussion in: http://stackoverflow.com/questions/10428113/why-http-request-with-fiddler-is-blazing-fast ?

My web application is built using Telerik.Web.UI.dll Version: 2014.2.724.45. I have a small demo web application, that illustrates this problem (and I have a simple test "host" application containing a WebBrowser control).

I made a copy of the web application, and updated to Telerik.Web.UI.dll Version: 2017.1.228.45 . This did not make any difference either.

I know that RadWindow internally uses an iframe tag to display the contents.Therefore, in my demo web application, I have an option to display the webform in an iframe on the page. This works fine all the time (no delays when running in a WebBrowser control). But I saw a different problem: when I add an iframe tag to the the page that contains the RadWindowManager, RadWindow does not work anymore (calling radopen() throws JavaScript exception).

If needed, I can supply the applications illustrating the problem.

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 27 Mar 2017, 02:00 PM

Hi Verner,

IE behaves very differently when embedded in an application and does have some issues. It has also been reported to resemble IE Compatibility Mode which is not supported. Thus, we do not support such an embedded browser and the ideas I can offer are mere guidance without any warranty of success:

 Considering your last paragraph on iframes loading fast but breaking RadWindows - my best guess is that the embedded browser has serious issues with iframes and I suggest you consider dropping them as much as possible. Using the window.open() approach is a viable solution too.

Regards,

Marin Bratanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Verner Lundsteen
Top achievements
Rank 1
answered on 27 Mar 2017, 02:43 PM

Hi Marin.

Thanks for answer.

 

I have experimented further since my first post.

RenderMode=Lightweight does not make any significant difference.

Adding an X-UA Compatible meta tag with value IE=edge does not make any difference. I already tried this, because I know that the WebBrowser control per default emulates IE7 (= "compatibility mode").

Problem is NOT isolated to running inside WebBrowser control. After opening 6-8 RadWindows in IE11 or Chrome, performance degrades, too. First window opens in < 100 ms – after 6-8 (non-modal) windows have been opened, loading time is > 1000 ms. After 10 windows  loading time is sometimes even > 20000 ms (yes, 20 seconds).

Only difference between WebBrowser control and normal browser are, that performance in WebBrowser control deteriorates already when opening 2. RadWindow.

I did find something, that DOES make a difference, though: Modal windows with DestroyOnClose=true performs OK no matter what number of windows get opened. This indicates to me, that problem is related to lack of client-side ressources (e.g. memory – it makes sense that each non-modal window opened uses some ressources, that cannot be released even when DestroyOnClose=true).

Modal windows with DestroyOnClose=false apparently leak ressources.

window.open() is NOT an option for me, because these windows are not modal (customer requires modal windows).

The issued I mentioned, that the existence of an iframe tag on page breaks RawWindows – this is also NOT limited to the WebBrowser control. This also happens in IE11 and Chrome. When calling radopen() (and page contains iframe), I get JavaScript exception:

TypeError: Cannot read property 'open' of undefined

 

Regards,,

Verner Lundsteen, CSC

0
Marin Bratanov
Telerik team
answered on 28 Mar 2017, 03:21 PM

Hello Verner,

When you close a RadWindow it merely hides with CSS. So, the iframe is still in memory. DestroyOnClose attempts to dispose it as much as is possible, so the browser can free up the consumed memory. Thus, this is a great solution to improve performance.

On the iframe issue breaking RadWindows - please isolate it in a small runnable sample and send it to us in a support ticket. This is not a known behavior and at this point my best guess is that the iframe causes an error that breaks all scripts on the page.

Regards,

Marin Bratanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Window
Asked by
Verner Lundsteen
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Verner Lundsteen
Top achievements
Rank 1
Share this question
or