stopping page bouncing back to top

  • Thread starter Thread starter mark
  • Start date Start date
M

mark

I have designed a large webform app (grid layout with VB behind), it has a
series of buttons on the page - but on postback (they have to) the page
bounces back to the top - which is quite annoying as theres quite a few
buttons - is there anyway to stop this behaviour ?

thanks
 
Or you could use something like this to set focus on a particular control

Private Sub SetFocus(ByVal ctrl As System.Web.UI.Control)

Dim s As String = "<SCRIPT language='javascript'>document.getElementById('" & ctrl.ID & "').focus()
</SCRIPT>"

RegisterStartupScript("focus", s)

End Sub
 
Back
Top