Anup Shinde
unread,Sep 29, 2005, 7:44:43 AM9/29/05Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to BDOTNET, Techdot...@googlegroups.com, dotnetuse...@groups.msn.com, -netind...@groups.msn.com
Hi,
Use this method to set focus to your web-controls. Hopefully, it
should work fine in all cases
-----------
Private Function SetFocus(ByRef ctrl As
System.Web.UI.WebControls.WebControl)
Dim strScript As String
If (ctrl.Enabled And ctrl.Visible) Then
strScript = " <script language=javascript>
document.forms[0]." + TextBox2.ClientID + ".focus(); </script>"
Page.RegisterStartupScript(ctrl.ID + "_focus", strScript)
End If
End Function
-----------
Call it like: SetFocus(TextBox1)
Regards,
Anup Shinde