Eilon Lipton wrote a fantastic article on how to write controls that are "AJAX-aware". By changing just a few typical lines of RegisterClientScript code and using a small bit of Reflection, you can determine if a page is using a ScriptManager or not and render client script appropriately.

Read the post at http://forums.asp.net/thread/1445844.aspx.