The JQuery code is fine. You must execute in the ready handler not in the window load event.
<script type="text/javascript">
$(function(){
var aspForm = $("form#aspnetForm");
var firstInput = $(":input:not(input[type=button],input[type=submit],button):visible:first", aspForm);
firstInput.focus();
});
</script>
Update
I tried with the example of Karim79(thanks for the example) and it works fine: http://jsfiddle.net/2sMfU/