| Comments

The first of my Silverlight videos have posted which cover some networking stuff that I’ve been blogging about already.  If you want to see a walk through of things you might have already read, please take a look at them:

There are more coming and I’m interested in hearing your comments so please give them.  If you have suggestions for things that need to be demonstrated to help others (or yourself), please let me know about them as well!

| Comments

If you are like me, you probably create a lot of projects in Visual Studio that end up getting thrown away and are intended just to test out a theory you have, double-check yourself when you are going mad because you can't find a bug, testing out something you read on a blog post, whatever.

Most of the projects I create are web projects.  I've started to adopt the "_Delete" mechanism to help me identify what I can truly delete in my folders later.  But is not the point here.  One thing that I do when creating web projects is use the Empty Web Site template:

I choose this template because it is the cleanest...it's actually what it says it is: empty.  It allows me to really isolate things as I'm the one adding things in, not the IDE.  So I usually follow that up with a new WebForm to get an ASP.NET page in there.  I write some code then CTRL+F5 it to run.  The first thing I hit is a build error.  Can you guess what it is?

Here's the thing.  When you choose the Empty Web Site template, you literally get nothing...no web.config, no default pages, no references, nada.  Like I said, it is what it is: empty.  But herein lies the problem.  The WebForm item template doesn't know that.  The WebForm item template is shared with all the web template types, which generally would be fine.  Let's do some digging to find out why I get a build error.

The WebForm item template is located in %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Web\1033\WebForm.zip.  This file contains the WebForm.aspx and code beside templates.  If you look at the CodeBeside.cs template within there you will see this line:

$if$ ($targetframeworkversion$ == 3.5)using System.Linq;

And there is the problem!  When I create a new web site, i'm using the .NET Framework 3.5 setting:

instead of any other target.  It makes sense because I'm doing 3.5 stuff anyway and I don't want to have to change it later.  But the problem is that the WebForm template now thinks that I already have web.config settings for LINQ, a reference, etc. and that is why I can't run...no references to System.Linq assemblies anywhere.

It's quite annoying for me, but I would imagine not most.  In talking with some product team folks, and I concur, people who choose the empty template are usually likely going to know what is up and make whatever changes needed.  Fair enough, but still slightly annoying only because I keep forgetting about it!

So since I find myself removing those using statements a lot, I decided to just change the template.  This, of course, is completely going to get overwritten any update in the future.  But for me, I think it made sense to remove them rather than to assume that I, the developer, will always be using LINQ in my web forms...which I'm not.  I'll choose to add it back in when I need!  So I simply removed the $if$ statements and I'm good to go.  I wish there was a way to say $if$ (3.5 && !empty)using System.Linq, but I'm okay with my minor change for me.

Anyhow, I thought I'd share this useless piece of knowledge as you might have come across it while checking out new development, tinkering with ASP.NET, creating shell web hosts, etc.  Hope it helps.

| Comments

I just saw two links that I simply have to promote as they are very helpful to people doing Silverlight development and one specifically with ASP.NET.

The first is a site on silverlight.net (you should bookmark this site as a resource and subscribe to all the feeds), there is now a Silverlight 2 Beta 1 control sample page, which hosts all the new Silverlight controls on the site.  It shows some different usage of all the controls:

Silverlight Controls Sample

Very cool to see all the controls implemented in one section, play around with them and see different styles in some as well.

The second link is awesome because when I read it I laughed out loud.  The reason wasn't because of the post, but because of a conversation I had with Pete Brown over email.  It is best described simply by showing you the email (privacy information blurred to protect the innocent):

Alas, Cameron Albert created an <asp:Silverlight> override control that enables using the control and supplying a splash screen XAML file and event handler.  This is great!  It enables you to still use the server control with ease but adds some customized functionality so that you can enhance the user load experience.  Essentially it boils down to:

<lg:Silverlight ID="silverlight1" runat="server" Source="~/ClientBin/Perenthia.xap" 
                Version="2.0" Width="800" Height="500" SplashScreenSource="~/Common/Xaml/Splash.xaml" 
                OnSourceDownloadProgressChanged="onSourceDownloadProgressChanged" />

Anyhow, I couldn't help but laugh when I saw that -- but it is a great post and control!  Great job Cameron!

| Comments

i've spoken a few times about axosoft.  they are a local ISV that does some great work.  their ceo, hamid, does a great thing every year for his employees (maybe more often) in encouraging and icubating new projects.  they have a core product, but also have incubated some great ideas.  some haven't lasted, but some live strong!  either way it is great to see what kind of ideas their group comes up with.

PureChat is one of those new ideas.  this is an idea that was just released.  it is for asp.net sites and is built using c# and asp.net ajax as well as the ajaxcontroltoolkit.  one of the developers, jonas, writes:

PureChat is written entirely with C# and javascript, against the 2.0 .NET framework. It uses Microsoft's ASP.Net AJAX, as well as selected controls from the AJAX Control Toolkit. Before I go any further, I just want to say that the Atlas (I think I'll always call it Atlas, it's shorter and sounds better) javascript framework really adds a lot of value and productivity for doing any sort of extensive work in javascript. Major kudos go out to that team at Microsoft. (emphasis mine)

very cool.  i just downloaded the free single operator key (this means operator, not incoming chatters) and installed onto my site in < 10 minutes.  i can't get it to play nice with subtext right now, but i'm going to see if the subtext list can help me out (httphandler collision and all).  as an operator i get a complete operator panel that gives me:

    • view of all chats
    • access to transcripts of chats
    • abandoned chats
    • multiple chats

it looks like this:

the end user gets a chat window they communicate with which looks like...well, a chat window.  what's cool is there is nothing for the user to install, and this runs in the browser using asp.net ajax technology.  i was really glad to see jonas' comment about how that framework enabled a lot of things a lot easier for him...that is good to hear.

so if you want to enable web-based chat on your site, you can get a free single operator license or right now they are doing a promotion for $5 for a 5-operator license.  this would be great if you need to provide online customer service in your site/application.  i don't think the intent is to put it on a blog (personal) or anything...at least i don't think that would be a good scenario for me i should say.  the operator has to be logged in.  but for scenarios where you have a product and customers, it would be a good thing to quickly add to your site (or product) and be able to directly communicate with your users.

good work axosoft...i can't wait to hear some behind-the-scenes stories on how it was to leverage the ajax framework for asp.net!  maybe they can add a silverlight UI at some point :-)

| Comments

recently i've been getting a few notes/questions about working with web services and asp.net ajax.  my colleague, rob bagby completed a series of great web casts last year covering the topic of the ajax libraries in detail, one of which deals with web services.  there are also two webcasts that deal with calling WCF services using the ajax libraries.  i highly recommend checking them out!