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



Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
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


Samples

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

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