Archive for October, 2006

11th time luck for media player?

Posted in Uncategorized on October 31, 2006 by Shaun

Microsoft have released Media Player 11 at last.  I’ve been playing with the Beta’s for a while now and I was reasonably impressed.  No HUGE groundbreaking changes for me, and although it is supposed to handle large media libraries better now the final Beta was flakey for me unable to handle several thousand MP3’s at once.  I only managed to import a clean library through several crashes that ungracefully dumped Media player forcing a restart of the application.

Fingers crossed that the final release is better.

Things I like:
The glossy black is pretty cool.
the ability to resize it so you just see the buttons is cool.
The new library features make managing your media a bit easier and I like the way it finally downloads all the album art without me having to go get the album info each time.

Media Player 11 is compatible with:  All versions of Windows except 2003. There is a Mac version available too.

Go get it here.

Media Player Download Logo


‘Simple’ Hello World in Microsoft Expression Web Beta 1

Posted in Asp.Net, C#, expression web on October 31, 2006 by Shaun

A recent look at Expression Web Beta 1 has left me with more grey hairs than I had before.

After installing the app and firing it up for the first time, the interface looks nice and invites you to start playing.  The split pane view between Design and ‘code’ view is nice, the fact that there is synchronisation between the two panes is great, non designer peeps will get a better Idea what goes on ‘under the hood’.

The real pain starts when someone like me, who is used to developing in Visual Studio, comes along and wants to try something a bit more adventurous than slapping a photo on a page and typing some text.  how about a bit of Hello World… the basic entry point for every developer in any language.

So, I drag an ASP.Net button onto the page, follow that up with a label.  Double click the button to get my OnClick Event… i said: double click the button to get the OnClick event!… Okay…. click the button once, go set the event through the events panel… erm… where the heck is the events panel?  how do I add an event to my button?

After trawling through the not a big ‘help’ and every menu and tab, I eventually called for some input from fellow developers in the same room… Thankfully one of them is still stuck in the stone-age and he remembered that you can add a C# <script> block to run script on a page.  So eventually this is the resulting ‘code’ from the page that eventually gets you an event.:

public void Test(object sender, EventArgs e)
Label1.Text = "Hello World";

This needs to be wrapped in: <script runat=”server” type=”text/c#”></script>  The runat=”server” bit needs to be there to get the C# code to fire and you’ll notice it’s not going to come up in the intellisense. 

I dunno! It seems like a real pain to me, ASP.Net pages are not going to be easy to put together in Expression Web as the Visual Studio 2005 Environments. Now that kinda makes perfect sense ASP.Net is a server development technology and Visual Studio 2005 is a development Environment. But why bother putting ASP.Net into Expression Web and spinning us all the marketing Yarn that you can develop ASP.Net pages with the same power as Visual Studio when you clearly can’t!
Another fine example of the Microsoft Marketing engine going into overdrive i guess…

It is of course perfectly possible I have completely overlooked the obvious and missed out something in my 1.5 hour ‘play’ with Expression Web, if so, feel free to put the record straight.

Css Control adapters updated to Beta 3

Posted in Asp.Net, C# on October 31, 2006 by Shaun

Scott Guthrie Blogged on Saturday that the CSS Control adabters for Visual Studio 2005 have been updated to Beta 3.
This seems like a really quick refresh as I only installed Beta 2 last week.

If you haven’t heard of the CSS adapters yet, I encourage you to read Scott’s post and follow the links to learn more, download the toolkit and start playing with them.

The CSS adapters are very cool indeed.  They take advantage of new features built into Visual Studio 2005 and basically give you a very easy way to override the way that controls are rendered.  using a small amount of code and a .browsers file to hook up the extender and control you can force a standard ASP .Net control to render CSS friendly markup in non tabular format.

One cool application I have been playing with in line with this is to have multiple adapters built into your custom control set then by simply deploying a different .browser file onto your server you can cause an application to respond differently.  Of course this only carries any weight if you can override more than just simply the render method in the adapter, adding extra behavioural changes to your control.  I haven’t yet completed a successful test but I’m not giving up just yet.

I’ll keep you posted with the results if I have any success, meanwhile if you have used the CSS adapters I’d love to hear whether you’ve used it in a way that differs from the original purpose they were designed for.

Persisting Custom Control Properties in C# 2.0

Posted in Asp.Net, C#, CC's Friends on October 30, 2006 by Shaun

I recently found myself in a bit of a pickle trying to persist some properties in a custom control I am developing at work.  My confusion was down to several properties persisting fine while other properties just would not maintain any values when I switched between source and design views in my test application.
I was ready to throw in the towel and put this down to a quirk with ASP.Net Custom Controls and try out some really complicated method to force the properties to persist when I stumbled upon something interesting.

If I set my property to be a string everything persisted, with no extra effort on my part for example:

public string Foo

works fine, while:

public double Foo

won’t persist.  A bit of research led me to believe that the .net framework takes care of strings for you.
I then noticed that all the properties I had that were not strings but were persisting just fine had a typeConverter applied to them, either custom converters I had written, or converter from the .Net framework.
for example:

public colour Foo

worked just fine… so I tried the following with the double sample above:

public double Foo

This resulted in the property persisting fine.

So, the reason for this post is two fold really, it may provide a clue to anyone else struggling to persist their properties as I was, but also it opens this up for comment as to whether this is the right way of going about this or whether there is indeed a better way.
Are there any performance hits to using a typeConverter in this way?

Microsoft ASP.Net 2.0 Ajax Beta 1 released.

Posted in Ajax Links, Asp.Net, Atlas, CC's Friends, Mochikit, Prototype, Rico, Script.Aculo.Us on October 22, 2006 by Shaun

If, like me you have been following the development of Microsoft’s own flavour of Ajax, codenamed Atlas, for the past six months or so then you won’t be surprised to know that they have released Beta 1 of what will become the released version of the product.

If you never heard of Atlas then fear not.  Atlas, or MS Ajax as I will now call it, is simply Microsoft’s take on the whole AJAX Scene.  AJAX is not a new technology but thanks to Google and a fair few other key players it has become the new must have technology on the web.

AJAX is actually an acronym that stands for Asynchronous JavaScript And XML.  It’s a bit of a mouthful I’ll grant you but its simply a tying together of the different technologies in web development in such a manner that web pages no longer act as a collection of static pages served up on demand.  With AJAX web developers can build web pages that are far more interractive with fewer post packs (page refreshes) because many of the operations on the page happen asynchronously so there’s no need to wait for one operation to complete before another starts.

So What is so special about Microsoft’s offering?  To be honest, not a lot.  the main difference between Microsoft’s version of AJAX and the myriad other AJAX libraries out there is that it is designed to tie in very closely with ASP .net 2.0 allowing developers using ASP .Net to incorporate AJAX into their applications.

Microsoft are not the only ones out there doing this though.
Ajax Pro and Script.Aculo.Us.netare but two I can mention, I’m certain that a quick ten minutes in Google will produce information on others.

Is it worth looking at the Microsoft offering?  I think so.  It’s not perfect by any stretch of the imagination, but the fact that Microsoft themselves are encouraging a community input on the project, and in some cases even making changes as demanded by the community, is encouraging.  The whole project has another upside to as we all get a deeper insight into the Microsoft Developer mindset.  This is encouraging as we get to see that microsoft Developers are not gods after all, they are just damn good at what they do, as are we all.

You can get hold of MS Ajax, and join in with the community here.

If, like me you also enjoy developing non ASP.Net Web Sites and fancy experimenting with adding Atlas to your projects, you may be interested in checking out Mochikit, Script.Aculo.Us, Rico, and the fantastic Prototype framework that most if not all of the Ajax libraries out there are based on.

I have not gone into great detail on any of these libraries here deliberately.  I have often fallen into the trap of simply reading up on one website all about a particular subject and not actually getting my hands dirty.  the result of this is that you know a lot and know nothing all at the same time.  Knowing that you can do x with y is not the same as knowing how to do x with y.  so go and play and then blog your results so we all benefit a little.

Coffee of the Day is Café Elvis, a dark roast from a small farm in Honduras, caffein rush level: 7/10