Archive for December, 2005

For catching a customized event in asp.net

In JavaScript, use __doPostBack(eventName,”);

And then you replace eventName with anything you wanna call and catch in server side.

In CodeBehind page, you can have a code below to catch the event and execute special tasks

If Request.Form(“__EVENTTARGET”) = eventName Then
your special task execution code.
End If

I know this is out of asp.net sync, but I found this so much convinient when you use javascript a lot with asp.net.

Color computation reference

I’m putting this as reference. This one I found is from one of Andrea’s presentation.


color = alpha

The reverse way:


alpha = color >> 24 & 0xff
red = color >> 16 & 0xff
green = color >> 8 & 0xff
blue = color & 0xff