Freigeben über


Problems hosting .NET user controls in Internet Explorer

So I’ve been working this one issue where remoting calls from a .NET user control hosted in IE are taking horrendously long. After the 1st atrocious call things behave “normally”. I’ve dome a lot of digging on this issue and have found some very interesting information I’d like to share.

These are related to hosting .NET user controls in IE

If you are hosting a .NET user control on a web page and are seeing very poor performance followed by normal/expected performance try the following things:

  1. Add the code below to the constructor of your user control. What this does is resolve a deadlock that is occurring within the framework. The delay you are seeing is a timeout in the framework for a call to complete. By calling the methods below you force one of the calls to run when the control loads which prevents the contention from occurring later during execution.

 

System.Configuration.ConfigurationSettings.GetConfig("simple text");

              string []a = Environment.GetCommandLineArgs();

  1. Q183110 – INFO: WinInet Limits Connections Per Server - https://support.microsoft.com/?id=183110 . Use this KB article to modify the maximum connections from 2 to 5. IE creates another thread to download your control and it’s possible that extra thread can exceed the connect limit (especially on a framed page or similar scenario i.e. multiple open IE windows).

I hope that resolves some of the issue you folks have been seeing. I know these types of errors appear to be mystifying and can lead to great frustration.

Comments