in OnClientClick event u can call the following function:
function valid()
{
debugger;
var s = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";
str=document.getElementById('<%=TextBox1.ClientID%>').value;
for (var i = 0; i < str.length; i++)
{
if (s.indexOf(str.charAt(i)) != -1)
{
alert ("The box has special characters. \nThese are not allowed.\n");
document.getElementById('<%=TextBox1.ClientID%>').value="";
return false;
}
}
}