I am creating HtmlButton dynamically in .cs file. Adding it to Panel using
HtmlButton b1 = new HtmlButton(); b1.Attribute.Add(\"onclick\",\"javascript:valid
on the javascript function return true or false and then add the return to your onclick as I show here.
function validateNclick(me) { if(allIsOk) { return true; } else { return false } }
and your attribute.
b1.Attribute.Add("onclick","javascript:return validateNclick(this);");