Previous Page Page 2 of 2 in the ASPNet category
# Saturday, 21 April 2007

When I first saw WPF/e in action, a thought ran through my head "Cool, this is MS's Flash like rich UI strategy where I'd be designing in XAML and coding the logic in any .NET language"

Now that WPF/e has been revealed as Silverlight, I've finally managed to sit down and take a closer look at it. And after my run throught the quick start and the various examples on the net, I realized something... Silverlight is NOT a Flash killer. Silverlight is not meant to be what Macromedia Adobe Flash is, Flash is an entire mini application platform (and a pretty nifty one at that) But Silverlight isn't that, Silverlight is more of a PRESENTATION technology than an entire platform. It doesn't even come with it's own script interpreter, all the logic is coded in Javascript (DAMN! I really really thought I could get away with .Net on this one) and the Silverlight plugin basically just handles the displaying of data.

This is exciting to me as a developer because now I have access to a rich presentation framework that I didn't have access to before (cause I didnt have time to polish up my Flash/ActionScript skills)

Confused as to why this is the case? Picture this scenario (ok.. I'd love to actually MAKE out the demo, but I've just started out here, so give me a break) Let's say I wanted to make one of those snazzy bar graph animations, say a list of mobile phones sold grouped by phone manufacturer. I want the bars to start extending from 0 to their values, and each bar to fade in following the complete extension of the previous one.

This animation is ridiculously simple to achieve in Flash, but the question is.. what if the data is not static? What if the data is supposed to come from a dynamic server generated source? Ah.. yes.. we can just use Flash's capability of performing HTTP GETs to a server page and grab a CSV file containing the values! But then what if the data is complex? We could probably just use XML to represent then data, and then walk through it with Flash's DOM explorer. But then.. here comes a huge problem, your Flash designer with his l33t actionscript skills doesn't understand the concept of how XML files work, he can't grasp the concept of an XML Element, Attribute, etc. etc. As a developer we'd waste time trying to hammer out a way to paste data to the Flash designer, while the Flash designer tries to work out how to read our data.

How does this change with Silverlight? First the designer will create the template of the animation  (he'll be DESIGNING which is what he's good at.) And then the developer will take the XAML which he generated and then using the template the developer creates an ASP.Net file capable of generating the full XAML of the graph and displaying it on a page (the developer will be CODING which is what he's good at.)

It's not that this kind of server side generation of rich animation like content wasn't available previously, Adobe has a product called FLEX which essentially (if I remember correctly) allows you to generate Flash files with server side backend code. Silverlight essentially opens the door of rich content generation to the other developers out there, without having to buy another server, or application platform.

Why did I mention OTHER developers instead of Microsoft technology based developers? As I mentioned, Silverlight is a PRESENTATION plugin, it reads and displays XAML, and all logic for client side interactivity is in Javascript (the language of choice for web client side interactivity coding... damn I miss VBScript.. curse those ;s!) So you don't have to be using ASP.Net to take advantage of Silverlight, you can use anything you like.. PHP, Java, PYTHON anything as long as you can deliver the XAML to the plugin.

There are still some hurdles that need to be jumped through first though, the main one being...

There Aren't Any XAML Editors Out There That Supports Silverlight Yet!

There isn't any *official* way to create the loose XAML files that Silverlight uses yet, you can probably rely on tools that create XAMLs for use with WPF, but there might be issues since there are certain extensions in WPF XAML files which aren't used in Silverlight. The current version of Microsoft Expression Blend which is THE application to create XAML with doesn't yet support Silverlight files, but with some slight tweaks I was able to use it to make XAML files suitable for Silverlight so I do believe that it's quite possible that Expression Blend will be released with support for Silverlight files.

Can't display HTML styled formating in it's textblocks

One really sad thing is that the text block doesn't support text that is HTML formatted, I don't mean anything like ACTUAL HTML formatting, I just want the <b>,<i> and <a> tags to work that would be super useful. Flash has this feature though, which is cool.

No Intellisense For Client-Side Scripting in VS2k5

Yes.. it's not essentlal.. but hey it'd be a VERY welcomed addition!

An end user probably wouldn't see what the big fuss about Silverlight is about other than MS trying to knock Flash off, but to developers who understand what can be done with Silverlight the possibilities are astounding. I personally can't wait to put Silverlight and Atlas together and take them out for a spin!

Saturday, 21 April 2007 08:45:40 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Thursday, 19 April 2007

As I was mucking around MSDN a few days ago I came across the article "Data Storage Architecture with SQL Server 2005 Compact Edition" It was essentially talking about where you could use the ever nifty SQL2k5CE. It also mentioned that you could use it with websites, something which I read from the SQL2k5CE Books Online that it wasn't supported. But the golden line in the article was this

If you choose to use SSCE for Web applications, some configuration is required to allow SSCE to be hosted in the Web application process.

I quickly rummaged through the documentation for SQL2k5CE more carefully this time, and I found this:-

AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true)

Aaaa.. the magic key! My eyes must have glazed over the paragraph the moment I read the part about ASP.Net not being a SUPPORTED host for SQL2k5CE. Essentially all you need to do is throw that line in your Application_OnStart event of your Global.asax file and you'll be able to use it in your ASP.Net application.

Wonder how performance is though, since the article mentions that SQL2k5CE should only be used on websites with a low performance of oh... <300~500 request an HOUR. I guess that would mean most personal websites that dont get slashdotted! ;)

Thursday, 19 April 2007 10:03:25 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Sunday, 11 March 2007

AJAX is the current in thing to do with interactive webpages, there's no lack of free frameworks available out there for achieving AJAX functionality in your webpages. Typically an AJAX framework will help you easily map out and call a function on your server side pages so you can do a query to a DB, perform an action, and then return the results to the client browser without incurring a post back.

The problem was.. AFTER you got the results back, how are you going to update the page? In order to present the results you had to be pretty well versed in manipulating the HTML DOM to rebuild say.. a table of query results, and that was the usual stumbling block when someone wanted to implement AJAX functionality on their webpages.

Then Microsoft released the ASP.Net 2.0 AJAX Extensions, which used a very neat *trick* to solve the update problem. With the AJAX Extensions installed, you first code everything JUST AS YOU WOULD NORMALLY and this is important, for the most part you don't need to change a thing on how you code. Then you identify which controls require to be dynamically updated and put them into a container control called the UpdatePanel and like magic, the control now updates without a post back!

And what I find to be the coolest feature of the Extensios toolkit? If for some reason the user disabled Javascript on their browser, or the browser doesn't support the javascript required to dynamically update your page. He can still have access to all the functions of your page because it would just post back normally instead of being dynamically updated so you don't have to worry about compatibility with lesser browsers!

Of course that's a very simple description of the magic that happens, but if you're an ASP.Net 2.0 programmer you owe it to yourself to check out the extensions TODAY! ;)

Sunday, 11 March 2007 00:33:33 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
Previous Page Page 2 of 2 in the ASPNet category