hey my above answer was for asp.
try below code in asp.net
add this code in page load event..
Button1.Attributes.Add("onclick", "return check();")
and the main thing is that... u missed javascript...
see the correct script below
<script type="text/javascript" language ="javascript" >
function Check()
{
var fours = document.getElementById("txt4s").value * 4
var sixs = document.getElementById("txt6s").value * 6
var totalrun = document.getElementById("txtRuns").value
var totalruns = fours + sixs
if (totalrun>totalruns)
{
return true;
}
else
{
alert("Total runs should be more then " + totalruns);
return false;
}
}
</script>