Allow RadAsyncUpload to failover properly when an out-of-date version of Silverlight is installed

7 posts, 0 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 03 Jul 2012 Link to this post

    Requirements

    RadControls version

     Tested on 2012 Q2

    .NET version

     Tested on 4.0

    Visual Studio version

     2010

    programming language

     C#

    browser support

    all browsers supported by RadControls


    PROJECT DESCRIPTION
    If you don't have Silverlight installed, RadAsyncUpload will failover to another upload method.

    However, if you do have Silverlight installed but it is an old version you are presented with the option to upgrade your Silverlight installation, but if you decline then you are stuck. RadAsyncUpload simply refusxes to play. This is a real problem for users whose IT departments refuse to upgrade their version of Silverlight

    The following code, based on code taken from http://www.silverlightversion.com will disable the Silverlight control on your page if the version falls below the minimum required for RadAsyncUpload to work allowing the control to failover to another upload method.
    Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function ()
    {
        // This code is based on (read: ripped off in a major way) the code from http://www.silverlightversion.com
        //try firefox/non-IE version.
        var nav = navigator.plugins["Silverlight Plug-In"];
        var installedVersion;
        if (nav)
        {
            for (var i = 0; i < 4; i++)
            {
                installedVersion = nav.description;
            }
        }
        else
        {
            //try the IE one now.
            try
            {
                var control = new ActiveXObject('AgControl.AgControl');
                //the following would be faster with a binary search, but this is "fast enough" for now. 
                var vers = Array(1, 0, 0, 0);
                loopMatch(control, vers, 0, 1);
                loopMatch(control, vers, 1, 1);
                loopMatch(control, vers, 2, 10000);
                loopMatch(control, vers, 2, 1000);
                loopMatch(control, vers, 2, 100);
                loopMatch(control, vers, 2, 10);
                loopMatch(control, vers, 2, 1);
                loopMatch(control, vers, 3, 1);
                installedVersion = vers[0] + "." + vers[1] + "." + vers[2] + "." + vers[3]
            }
            catch (e)
            {
                return false;
            }
        }
        if (installedVersion == null)
        {
            return false;
        }
        return installedVersion >= "4.0.50826";
    }
    function loopMatch(control, vers, idx, inc)
    {
        while (IsSupported(control, vers))
        {
            vers[idx] += inc;
        }
        vers[idx] -= inc;
    }
    function IsSupported(control, ver)
    {
        return control.isVersionSupported(ver[0] + "." + ver[1] + "." + ver[2] + "." + ver[3]);
    }

    --
    Stuart

  2. Andy
    Andy avatar
    27 posts
    Member since:
    May 2011

    Posted 14 Sep 2012 Link to this post

    This type of check should be part of the control itself. It's a shame it has to be implemented separately.
  3. Plamen
    Admin
    Plamen avatar
    2730 posts

    Posted 19 Sep 2012 Link to this post

    Hello Andy,

     
    Thank you for sharing your opinion with us. 

    We have inspected this option when this Code Library was created but it came out that some customers need the current behavior. That is why we decided to leave it as it is for the moment and if anybody needs to change the default functionality to apply the code above.

    Hope this will explain the issue.

    Regards,
    Plamen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  4. Andy
    Andy avatar
    27 posts
    Member since:
    May 2011

    Posted 19 Sep 2012 Link to this post

    The control should work in all circumstances by default. If you have "some" customers that don't want the control to work when a user is in a very common situation (outdated Silverlight version), those customers, who are in the minority, should be the ones that have to implement custom code. As is, your control doesn't work properly without implementing this custom code. That will be a factor when I consider purchasing your controls again in the future.
  5. Plamen
    Admin
    Plamen avatar
    2730 posts

    Posted 21 Sep 2012 Link to this post

    Hi Andy,

     
    Thank you for writing again and for your concern with RadControls.

    We have reconsidered the issue once again and created a new feature request of adding a property that will control this behavior according to the every clients needs. You can follow its implementing and vote for increasing its priority here

    All the best,
    Plamen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Kyle
    Kyle avatar
    1 posts
    Member since:
    Apr 2013

    Posted 10 Feb 2014 in reply to Plamen Link to this post

    Hi, the link in the above, does not appear to work (to me). I'm curious to determine if that feature has been implemented and is available in the latest release or not. (Or to navigate to the features' request page so I can follow the topic.)

    Thanks,
    -Kyle 
  7. Plamen
    Admin
    Plamen avatar
    2730 posts

    Posted 11 Feb 2014 Link to this post

    Hello Kyle,

    Unfortunately the feature is still not implemented -you can follow it here.

    Regards,
    Plamen
    Telerik
     
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
     
Back to Top