Creative Jar Blog RSS Feed

Virtual Earth meets Silverlight

April 15, 2009 09:46 by tim

I went to a Virtual Earth developer day at TVP the other day and one of the big releases that they demonstrated is the new Virtual Earth Silverlight control

Currently in a Community Technology Preview status, the control builds on the fluidity of DeepZoom to provide mapping over a really slick looking canvas.  Being that it's silverlight based, the canvas is really responsive compared to the AJAX implementation that is the current fashionable flavour

The controls can be downloaded from the Microsrof Connect website.  This MSDN blog really isn't lying when it says you only need to type 2 lines of code to get a basic looking map out of it :  http://blogs.msdn.com/virtualearth/archive/2009/03/18/introducing-the-virtual-earth-silverlight-map-control.aspx

Just add the references and make a simple Map Tag and you're away.  Making overlays is really simple and this guy has plotted the course and speec of the top 4 marathon runners in the New York Marathon, however i can only see 3 points : http://conceptdevelopment.net/Silverlight/VEMap01/default.html

He's actually plotted a few of the recent marathons in a few cities around the world.  The map pans to follow the runners

I have a demo that i created to highlight how easy it is to implement.  The app took around 10 minutes to create, including downloading the control from Microsoft Connect!!  http://silverlight.creative-jar.com/maps/default.html


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

asp.net Pager TemplatePagerField

March 12, 2009 17:42 by tim

Been working with the new ASP.net pager control and i must say I'm impressed

when it was all .net framework 2.0, we'd been working with a nice little usercontrol which handled all it's postback internally and we had pretty good control over the markup.  Then .net 3.5 comes on the scene with it's listview and pager, so we thought we should give them a go

It was a partially good experience but the lack of mark-up control was pretty limiting.  I'm not much of a front-end guy so i just plumped for the standard layout and went with that.  However, as our front-end guys show much more attention to look & feel than I do, they demanded better markup, nicer buttons, parameterised visibility, the lot basically

We saw there was a TemplatePagerField node for the datapage and http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.templatepagerfield.aspx showed us we could literally spoon any kind of controls and mark-up into it.  The server side functinalty opened my eyes to some new counters i didn't even know existed.  I was used to the listitem having a container, kind of like a row in a database, but the pagers container is actually the entire collection of rows.  Kind of obvious when i think about it as i was only ever throwing it the whole set and it did it's thang and paged the data as required.

Also, you can have any combination of fields so you can still use the standard pager ones.  i particularly like the page buttons one which gives you a link to each page so the users are not forced to keep pressing next and previous to get to the products 

check it out though.  Saved us loads of time recently :¬)


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

jQuery XML and MIME types

February 16, 2009 08:49 by tim

We're really getting into jQuery these days.  Since it's adoption by the .net framework team, we're seeing more and more AJAX UI with data read in via jQuery to make some really cool looking sites

However, there was a problem we had recently with MIME types. We host all our stuff on IIS and this comes pretty much ready-rolled with most of the MIME types set up.  For those of you that don't know what a MIME type is; It's a rule which the web server uses to process certain files based on their extension. JPG, for example, is pretty much going to be a picture so the server allows these as binary downloads, whereae ASPX is a server-side page so the MIME type for ASPX runs through an extra process to translate the code into a working web page

Browsers also use the MIME type to decide how to display the pages, or images, and set them up correctly in the browser. application/rss+xml signifies that there is an RSS feed somewhere nearby and the browser will then highlight the Feed button so the user know where to get the feed from and set it up in their favourites

Which brings me nicely on the the problem that this post is meant to remedy.  We were using the jQuery $(document).ready(function(){$.ajax({type: "GET",url: "tim.xml",dataType: "xml", success: function(xml) { stuff to retrieve the xml and the process the node we were interested in.  Worked fine locally using IIS on any browser we threw at it.  However, we had to upload this to a 3rd party server and the "text/xml" MIME type hadn't been set up.  FireFox didn't seem to mind, but IE was throwing it's toy out of the pram and just not playing ball whatsoever.

After much blog and forum digging, we cam across the explanation on the jQuery site : http://docs.jquery.com/API/1.1.1/Ajax

So there you have it; if somethings not behaving as it should, before you change the code, be sure to verify your MIME types are set up as they should be. I initially thought this was an issue with $(document).ready but amending this didn't fix my issue!!

 

 


Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

NxtGenUg Session : Designer - Developer workflow

January 20, 2009 09:16 by tim

Have just returned from Coventry after doing a Designer-Developer workflow seminar for NxtGenUg. 

Really good crowd last night I thought.  We had a few issues with controls not rendering and events not firing on our Mix07 application, as is the way with a live demo I suppose, since you don't have time to iron out the imperfections and all that.  We even had a bit of time to demo a pet application of mine, DynamiChazm, which allows for dynamically updatable and taggable DeepZoom images.  More to follow in a future blog :¬)

Thanks to Richard Costall for hosting it and allowing us to present out 'thang'.  Simon and I had a great time


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Silverlight : Grow your own controls

January 13, 2009 17:50 by tim

We had an issue on an early version of a silverlight app we wrote.  the whole thing was a banner which was fed data from a SharePoint list.  The site itself was multi-lingual so the same sentence coudl be one and half times as long in, say, the German version as it was in the English version

Being a data-binding kind of person (?), I opted to use Silverlights inherently powerful DataBinding features and have it fill the text from a custom object I got from the list.  However, since th controls were coded into the xaml, the size of the box was causing truncation in some instances, forcing us to set it to be the width of the logest piece of text we would ever encounter, not a very clever solution but good enough for the dev site

Re-visiting the code for live, I had a brain-wave.  I knew that silverlight could handle the dynamic sizing, Blend was all over it and the area was expanding and contracting as needed.  So, i broke it out of the xaml, turned it into a usercontrol, and then added it to the canvas at run time, after i'd set the text from the data.  Then, when the control renders, it's the correct size for the text it contains :¬)

Job done :¬)


Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Wrong User Agent?

January 12, 2009 17:43 by tim

Ever been to a site and been accused of having an old browser?  Like it warns you to upgrade you Internet Explorer version from 6 to 7 before it will show you stuff?

Seems there's a few Windows machines out there with some dodgy Registry settings.  There is a key in there which hard-codes your user-agent, rather than letting the broswer do the talking

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSettings\User Agent\Post Platform]

This should be empty in order to post the corerect version. There are some facebook users who are getting the IE6 version and messages because this key is hard-coded to IE6  

WARNING : EDIT YOUR REGISTRY WITH EXTREME CAUTION!!


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Mix 2009 : 10k Silverlight apps

December 22, 2008 11:07 by tim

Microsoft have announced their latest competition for the Mix 2009 event in Las Vegas. 

They're running a competiton whereby you can submit a Silverlight app to their galley.  The only caveat is that all the source code and related files must all be under 10k in total.  Interesting challenge!!

We've submitted a Mandelbrot generator.  It's pretty heavy on the browser as it needs to generate around 100,000 points for the low resoltion version, but it's interesting what you can do with just 10k of code!!

http://2009.visitmix.com/MIXtify/TenKGallery.aspx

Check out the gallery.   There are some interesting ideas in there, some weird ones too!!


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Could not load file or assembly App_Web_

December 11, 2008 12:12 by tim

I was getting a weird error in a site which is using WCF.  The application is silverlight and uses the WCF service for all it's data interaction.  However, while the Silverlight would load, any data access was failing.  A quick browse to the address of the service gave me the dreaded "Could not load file or assembly App_Web_yadayadayada"

Strange error really, giving that I never use the published site where the app_web_xxxxxxx dlls are generated, always plumping for the Web Deployment Project flavour of deployment as it's cleaner for uploading and quick aspx or code-behind changes as you don't have to upload the whole site everytime you publish

Turns out there's an attribute you can add to your web.config to stop all this recompilation stuff

In the compilation tag , add the following attibute.  Makes the site run a little faster due to not having to load debug symbols and also stops the batch recompilation of your bin folder when the AppPool recycles 

<compilation debug="false" batch="false"> 

Job done:¬)


Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

LINQ : Why hardcode anything?

November 21, 2008 17:06 by tim

Man, this LINQ stuff is amazing

I was dubious at first, to be honest.  I'm confortable with SqlCommand and the logic required to build relational data with Foreign Keys and Cascade delete ; "Who needs another data access language??", I said

The more I use LINQ, the more I'm glad it's here.  I did some old school SqlCommand stuff yesterday afternoon, normalising a flat data structure into something a bit more updatable.  Sqlcomands for every different insert, multiple parameters and data types, cycling through DataSets and filling the data as I went.  The debug was a total nightmare with all the hardcoded parameter names and insert statements

The fruit really materialised when I re-did the data access for the site in question.  Strongly-types objects which would only accept normal data, automagically created List<> of related data, so easy to update and even transaction to boot. 

LINQ does enforce a strict data layout and naming convention, but its well worth it

/never looks back!!


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Line 1934 : Error in Loading DLL

November 5, 2008 10:46 by tim

I was having trouble with my intranet this week.  Ever since I uninstalled Silverlight Beta 2 and replace it with RTW I've been getting this weird error "Error loading DLL"

It wasn't affecting functionality as far as I could tell, but it sure was annoying!!

Anyway, it turns out I needed to repair my Office installation to get rid of the message.  45 minutes later and all is well

Fingers crossed it doesn't return


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: Tim Hustler
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Calendar

February 2010
SuMoTuWeThFrSa
31123456
78910111213
14151617181920
21222324252627
28123456
78910111213