AKA Marketing.com Logo            VISIT THE BLOG            

Blogged thoughts, is our web blog. Expect views, opinion, rants and tirades about everything and anything 

« Home / Forums »        

 


Subscribe to our SEO / IT related blog by entering your email address below

Blogged thoughts

| by the www.akamarketing.com team

Archive for March, 2009


Web developer tools included with Internet Explorer 8

Sunday, March 22nd, 2009

I downloaded the latest version of Internet Explorer the other day and although at this stage I can’t comment too much on the browser as a whole I was pleasantly surprised by the developer tools included with Microsoft’s latest release. I’ve used the developer toolbars for IE 6/7 & for Firefox but it’s good to see something like this included in the core IE program.

Common developer tasks such as viewing pages in different resolutions, quickly viewing outlines of pages (CSS classes, DIVs, tables, image containers etc.), validating pages and measuring elements are all included. In fact pretty much everything needed to decompose & desect webpages is available including a nice Javascript debugger which means you won’t have to switch to Firefox to see meaningful JS related messages anymore. I’m also liking the CSS profiler which enables a developer to turn CSS element definitions ON/OFF and have the page update to reflect changes without a page refresh, this is quite powerful as it allows developers to quickly see what works best in their pages.

Although not part of the developer tools as such, IE 8 also includes a compatibility mode which will allow surfers view pages in IE7 mode. This is important as IE 8 is now a standards based browser where previous versions where not and thus pages designed with IE 7 in mind mightn’t look correct in IE 8, if this happens a user can emulate IE 7 with a simple click of a button. This is going to create a small pain for developers as they might have to change their CSS to make pages look the same on IE 7 & 8, however in the long term it is the best thing Microsoft could have done as going forward cross browser compatibilty should become less of an issue for developers/designers.

There’s some good content about IE 8 itself and its developer tools around the web including the below: 

Why are standards based browser ‘better’?
http://samanathon.com/internet-explorer-8-passes-the-acid2-browser-test/ 

Review of developer tools
http://coolwebdeveloper.com/2009/03/fantastic-new-javascript-debugging-tool-with-ie-8-and-its-list-of-features-hard-to-live-without/ 

Extensive review of developer tools
http://www.code-magazine.com/Article.aspx?quickid=0811082


ASP.NET AJAX 3.5 error - “Sys is undefined” workaround

Monday, March 2nd, 2009

I was trying to put together a prototype for a potential client but kept on getting a ‘Sys is undefined’ AJAX error when I tried to run it on my host Blacknight.ie, however when I ran it on another host - discountasp.net everything worked fine. It also worked fine on my local development machine which consists of Visual Web Developer 2008 SP1 and .Net 3.5 SP1.

There’s an absolute tonne of blog posts and forum threads on this topic but I couldn’t find an exact fix. Things like modifying the web.config are most often mentioned but that ‘fix’ usually relates to environments targeting .Net 2.0 (before AJAX was included a part of the framework core).

One blog post that did point me in the right direction was:

http://blogs.msdn.com/webtopics/archive/2009/02/27/asp-net-ajax-functionality-not-working-on-the-page-getting-sys-is-undefined.aspx

It turns out that the ‘Sys is undefined’ error most likely occurs because the actual Javascript functions which power AJAX are inaccessbile to your .aspx pages for some reason. As suggested in that post I looked through my IIS logs to see if ScriptResource.axd was being found as that is the file that is required to ‘inject’ JS into AJAX enabled pages. It was not being found as the IIS log line below shows :

2009-03-02 08:27:54 GET /ScriptResource.axd 89.204.251.252 HTTP/1.1 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-GB;+rv:1.9.0.6)+Gecko/2009011913+Firefox/3.0.6+(.NET+CLR+3.5.30729) http://d1004190.blacknight.com/davetest.com/ajaxtest d1004190.blacknight.com 404 0 1741

The reason for this can apparently be a number of things including bad web.config configuration, bad IIS configuration and incorrect assemblies (mismatch between expected versions & actual versions) in the GAC. I’m pretty sure it’s a blacknight configuration issue though due to the fact it worked on my local machine and on discountasp.net. I’ve sent Blacknight the above link anyhow so watch this space.

What is the Sys is undefined workaround then?
AJAX is as many of you surely know just really javascript and thus ‘under the hood’ Microsofts AJAX implementation is just really Javascript. Knowing that non ASP.Net developers might want to get their hands on a good AJAX framework Microsoft has made their framework (basically a load of .js files) available from their AJAX downloads page.

These can be used by .Net developers in conjuction with the scriptpath property of the scriptmanager control on your page to allow you to remove dependency on your server and actually include the JS code required to run controls like UpdatePanel, Timer etc. with your regular Javascript stuff. This is what I did and it worked fine on the local machine (surprise, surprise) but still on Blacknight the JS source wasn’t being found. I examined the source code of my page on Blacknight and the src tag that was outputted was:

<script src=”MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjax.js” type=”text/javascript”></script>

However the version of the library available from the downloads page mentioned above is 3.5.30729.1. I renamed the version on the host to 3.5.21022.8 (better to download the right library of course), refreshed and it worked perfectly from then on. Interesting the src tag outputted from my local machine correctly referenced library version 3.5.30729.1.

Why does the framework on blacknight look for version 3.5.21022.8 but discountasp.net and my local environment look for 3.5.30729.1?. I’m not 100% certain but machines with 3.5 sp1 (discountasp.net & local machine) must be configured to ‘look’ for an AJAX library of a particular version, while machines of 2.0 or 3.5 will look for other versions. This means in theory a mismatch between what version of the AJAX library (well what version of the containing assembly - ‘System.Web.Extensions’ to be more correct) the framework expects and what version it finds (or doesn’t find for that matter).

To check if there’s a mismatch you could set the scriptpath property of the scriptmanager to some abitary value, upload, check the src statement which will look similar to the one above to see the expected version of the System.Web.Extensions assembly you need and then you could use reflection to check the actual version you have… of course I’m not certain on any of this mismatch business, casual theory only. 

What I do know however is that ‘Sys is udefined’ basically means that for whatever reason javascript code required to ‘run’ AJAX is missing, so if you cause .net to reference it in the traditional way (ie. .js files in your www folder) by using the scriptpath property it appears to be a fairly solid workaround.

HOME | ABOUT US | CONTACT US | SITEMAP | GOOGLE SITE SEARCH | TOP
12 Lorcan Crescent, Santry, Dublin 9, Ireland +353 87 9807629