If you want to set focus to a textbox you do like this
In the top of the aspx.vb you place:
Imports System.text
on page load, for example you do this:
dim str as new stringbuilder
str.append("<script language='javascript'>")
str.append("document.getElementById('Textbox1').focus();")
str.append("</script>")
registerstartupscript("Focus",str.tostring)
The first paramenter in the registerstartupscript is only
a key to the script taht you register in your page.
You can use the IsStartupScriptRegistered("Focus") to
know if your script is already register in your page, to
prevent you from writing the code all over again.
I hope this help you.
Ana Rita
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.