Javascript

Detecting Silverlight Version Installed

Detecting the Silverlight version installed on a client machine isn’t entirely straightforward. To do so, one has to use Javascript. Unfortunately even though Microsoft ships a Silverlight.js in the Silverlight SDK, this script only has the ability to tell whether a specific version is supported on the client’s machine; it does not support returning the installed version.

For this reason I have created a simple Javascript function returning the Silverlight version number installed on the client machine or returning -1 if Silverlight is not installed. The source code can be downloaded from here:
SilverlightVersion.js
The script can be used the following way:

var slVersion = GetSilverlightVersion();
if(slVersion != -1)
   document.writeln("Your Silverlight version is: <strong>" +slVersion + "</strong>" );
else
   document.writeln("<strong>Your do not have Silverlight installed on this computer</strong>");

And this is the script in action:

If you’re interested in how the script actually works and what the Silverlight version numbers mean, read the post on my ScottLogic blog: Determining Silverlight Version Installed – source code & explanation

Animated Christmas Card using jQuery

As the holiday season is close I was looking for a way of sending a simple, yet nice animated Christmas card to friends. I wasn’t looking for one of the many popular sites offering e-card sending, instead I wanted something I could somewhat customize, put on my server and send the link to friends and family so they could view it in their browsers.

At first I was thinking of creating a simple application with fading pictures in Silverlight. However I’m intending to send it to some older relatives whom I don’t want to have to mess with installing the Silverlight plugin – they would probably skip from that point. Doing the card in Powerpoint was not an option as not all friends have software to open it. So that left me trying to find a Flash application that does something like that – without any luck. So at that point I almost gave up. And then realized that I’ve forgorren about one of the most simple cross-crowser solution: using javascript to do the job.

So I’ve created a nice greeting card using jQuery that fades in a few images like it was a slideshow and writes out a greeting message in the end. You can take a look at it working here: Christmas Card using jQuery demo, and here’s a screenshot of what it looks like:

jQuery Christmas Card - preview

I’m sharing the complete application for further re-use, you can download the package here: source code for Christmas Card using jQuery. It consists of a html page, a css file, some demo images and a javascript file. If you want to create a similar nice greeting card, you can do it the following way:
Read More…

ASP.NET server side element names changed?

As far as I’ve known if the ClientID of a server control looked someting like this:

ctl00_WebPartManager1_184c801b_7c67_4967_be37_3ab10406f967_ctl00_linkVote1
.

Then the name sent on postback (which identified the control on the server side) was:

ctl00$WebPartManager1$184c801b$7c67$4967$be37$3ab10406f967$ctl00$linkVote1
.

But since some time the _ to $ conversion is not true any more. Instead the _ signs are randomly replaced by dollar signs. Recently the name sent back on postback is:

ctl00$WebPartManager1$184c801b_7c67_4967_be37_3ab10406f967$ctl00$linkVote1
.

This change screwed up quite a lot of client side manual __doPostback() codes I’ve written – most of the making these invokes due to JQuery addons.
Read More…

Building an AJAX Tree control

Recently I’ve been in need to create use a tree control that is capable of doing the following:
- Displays tree items
- Branches can be opened to see children
- The tree is dynamically built to minimize server load

I was sure that there are plenty of solutions out there that I could use. After doing some search I found that the Ext framework offers a control that would be easy to integrate and use. So if you’re interested in how to integrate the Ext tree control with an ASP.NET or PHP backend to have it work like the Ext tree sample, read on.
Read More…

 Scroll to top