Did you include a script manager on the page? Here's an example that should work:
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Example</title>
<script type="text/javascript">
function pageLoad(sender, args) {
Sys.UI.DomEvent.addHandler(
$get('Button1'), 'click', function(eventElement) {
alert('button clicked');
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"/>
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>