Remove the keypress from body tag and use the following script as shown in the sample
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<script type = "text/javascript">
window.onload = function () {
var txt = document.getElementsByTagName("input");
for (var i = 0; i < txt.length; i++) {
if (txt[i].type == "text") {
txt[i].setAttribute("onkeypress", "return false;")
}
}
};
</script>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
<asp:TextBox ID="TextBox2" runat="server" TextMode = "MultiLine"></asp:TextBox>
</form>
</body>
</html>