OnClientClick="return ValidateFunction()
OnClientClick function which we write in javaScript execute on client side before control passed to server and after that
OnClick=" btnSubmit_Click"
executes on the server if your
ValidateFunction()
returns true.
try to debug your javascript validateFunction on server and check what it is returning.