ASP 101 - Active Server Pages 101 - Web01
The Place ASP Developers Go!

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash

ASP.NET version of "Colors"

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.

Here's a zip file of the code (1 KB).

Play with the running version.

View the live source code.

Back to the "Colors" sample


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers