You need to use button1.attributes.add("onClick", "Javascript code goes here") in the codebehind.
There's a good tutorial for this here: http://aspnet.4guysfromrolla.com/articles/021104-1.aspx
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
You need to use button1.attributes.add("onClick", "Javascript code goes here") in the codebehind.
There's a good tutorial for this here: http://aspnet.4guysfromrolla.com/articles/021104-1.aspx