Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim login As UserControl = DirectCast(Me.FindControl("ctlLogin"), UserControl)
login.Focus()
Dim button As Button = DirectCast(login.Parent.FindControl("LoginButton"), Button)
Page.Form.DefaultButton = button.UniqueID
End If
End Sub
|