Building a Photo Tagging Application using ASP.NET 2.0, LINQ, and Atlas

 

Over the last few days I’ve spent some spare time playing around with LINQ and LINQ for SQL (aka DLINQ) – both of which are incredibly cool technologies. 

 

Specifically, I’ve been experimenting with building a photo management application that provides “tagging” support.  If you aren’t familiar with photo tagging, you might want to check out FlickR – which implements a tagging mechanism that enables users to easily annotate pictures with textual words that provide a way to easily organize and sort them.

 

For my photo-browser I wanted to implement a “tag cloud” on every page of the site that lists the most popular tags in use on the left-hand side, and enables users to be able to click a tag within the “tag cloud” to filter the pictures by them:

 

 

When a user clicks on an individual picture I then wanted them to see a more detailed version of the picture, as well as all the tags it has been annotated with:

 

 

I then wanted end-users to be able to click on the “edit tags” link on the page to switch into an edit mode using Ajax, where they can easily create or edit new tags for the picture.  Any word can be suggested:

 

 

When the tags are saved, I wanted the “tag cloud” to dynamically update with the current list of tags being used across all photos on the site, and size each tag within the cloud based on the tag’s frequency (higher usage frequency produces bigger font sizes for that tag):

 

 

Implementing the above application is really easy using ASP.NET 2.0, LINQ and Atlas, and provides a nice demonstration of some of the really cool new data capabilities that LINQ enables.

 

Click Here to Read My Step-By-Step Tutorial of How to Build the Above Application using LINQ, ASP.NET 2.0 and Atlas (full source code provided)

 

Hope this helps,

 

Scott

 

 

16 Comments

  • Very cool and very nice application

    One question can LINQ be used on a live asp.net website on a shared server?

  • Excellent as usually. I personally really find the practical application examples more helpful than just random tips. Don't get me wrong, I love the random tips too, but I really, really love real-world examples that tie everything together.

  • Wow, you took that photo at the Microsoft Campus? :)

  • Hi Ashok,

    The current LINQ CTP requires full-trust support on the server, which means it doesn't support partial trust deployment yet (which is what many shared servers use today).

    However, future builds of LINQ will fully support partial trust deployments -- so you will definitely be able to use it in shared hosting scenarios.

    Hope this helps,

    Scott

  • Hi Sahil,

    Actually I took all of those pictures on a trip to South Africa and Botswana that I did two years ago.

    There are a few wild animals wandering campus here in Redmond -- although mostly they are just ducks on the pond. :-)

    Thanks,

    Scott

  • Well see, I'll be there in August, and you'll have a wild bear on the campus. ;)

  • So nice! Thank you so much. BTW do you perfer using FF rather than IE?

  • Can LINQ be added to an exisitng 2.0 site since it needs the 3.0 compiler? Or can only new sites use LINQ?

  • Scott,
    Any word on when Go-live license will be available for LINQ?

  • Hi Eric,

    I actually use IE as my main browser and prefer it over FF. I used FF in the screenshots above mainly because people often ask whether the sample I build work in both IE and FireFox. Proving the cross-browser compatibility via the screen-shots helps answer that question.

    Hope this helps,

    Scott

  • Hi Ashok,

    You'll be able to add LINQ to an existing V2.0 site (ASP.NET 2.0 can be configured to use the new compiler).

    Hope this helps,

    Scott

  • Hi Kevind,

    We are looking to have a go-live license for LINQ as we get a little further along. There are definitely a lot of people asking for it!

    Thanks,

    Scott

  • If I didn't install LINQ and Atlas, can I implement it with your source code ?

  • Hi Kaol,

    You'll need to install the LINQ May CTP build in order to implement my sample above.

    Hope this helps,

    Scott

  • Will LINQ* be available in .NET 3.0?

  • Travis:

    .NET 3.0 is WinFX -- WPF/Avalon, WCF/Indigo, etc.

    LINQ is part of Orcas, which comes later.

Comments have been disabled for this content.