Monday, August 18, 2008

AJAX Calendar Extender only shows partial weekdays

The Calendar extender in my page only shows 5 days in a week, instead
of a full 7 days. There is no parameters controlling this behavior.
After some investigation I found that's because I have defined padding
in my stylesheet for TD:

TD {padding-left:5px;padding-right:5px;}

Generally it's not a good idea to change the general TD style,
especially third-party control will be used. I put the padding in my
own table class then problem solved!

Wednesday, August 6, 2008

Call server postback from ModalPopup extender

The Atlas AJAX Toolkit has a very convenient ModalPopup extender. However by default it doesn't do post back on button clicks, even the event is wired with the button:
< runat="server" id="btnAddExistingPart" text="Add" cssclass="SplashButton" onclick="btnAddExistingPart_Click">
Upon click it only dismiss the modal popup.

You have to explicitly call the post back client method to initiate the post back:
protected void Page_Load(object sender, EventArgs e)
{
...
btnAddExistingPart.OnClientClick = "__doPostBack('" + btnAddExistingPart.UniqueID + "','')";
...
}

Monday, August 4, 2008

System admin script

To lock the workstation (tested on Win2K/XP): rundll32 user32.dll,LockWorkStation