Hi,
What about your javascript? ScriptManager just will render some script on the client. Please put your code after "form" tag and don't forget type ";" for each line of code.
In general, if we want to build a custom control with Ajax, we had better make use of ScriptControl or ExtenderControl to build it. So we need make the ajax control derives from ScriptControl or ExtenderControl class, instead of webcontrol. That will be better in this way to build an ajax control.