Hi,
Try this:
HTML:
<asp:TextBox runat="server" ID="TextBox1" onkeypress="KeyPress(this);" />
JavaScript:
<script type="text/javascript" language="javascript">
function KeyPress(value)
{
if (value.keyCode == 32)
{
alert('Space not allowed');
return false;
}
}
</script>
All the best.
--Amit