Here's an ASP.NET version of our classic "Colors" script.
While there's no rocket science involved here, the script is still a good
example of lots of different things.
Basically this script just plays around with some colors.
That said, it's a great example of a couple different
things. Not only do I use ASP.NET's HTML controls instead
of the Web controls that I normally use, but I also show
you how to apply a style to an HTML control. And if that's
not enough... it's also the first time I've published
something that uses the elusive OnServerClick.
Notice how much shorter and simpler it is then it's classic ASP
counterpart. ASP.NET's built in state management is the main reason for
that, but being able to assign the style properties programmatically
helps some too... especially in the simplicity department.
Anyway there's not much else to say. Some controls, some styles, a little
string concatenation, and a couple lines of code and we're done.