|
-
August 2nd, 2005, 03:38 AM
#1
textbox
how to put focus on textbox?
-
August 3rd, 2005, 11:48 PM
#2
Re: textbox
You can write a javascript code in the code behind class
Here is an example This might be helpful, I have not tried it ..
Protected Sub SetFocus(ByVal ctrl As Control)
Dim strbuild As New System.Text.StringBuilder("")
With strbuild
.Append("<script language='JavaScript'>")
.Append("function SetFocus()")
.Append("{")
.Append("document.")
.Append(ctrl.Parent.ID)
.Append("['")
.Append(ctrl.UniqueID)
.Append("'].focus();")
.Append("}")
.Append("window.onload = SetFocus;")
.Append("")
.Append("</script")
.Append(">")
End With
ctrl.Page.RegisterClientScriptBlock("SetFocus", strbuild.ToString())
End Sub
Call SetFocus(textbox1) in the page load event
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|