I had to translate it so it would work with masterpage and codebehind.
I came across this. Works great. Now even the default button is set if you press enter.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
SetFocus(Login1)
Dim ctl As Control = Login1.FindControl("LoginButton")
Login1.Attributes.Add("onkeypress", String.Format("javascript:return WebForm_FireDefaultButton(event, '{0}')", ctl.ClientID))
End Sub
GoodLuck
Arno