Set Focus to control after postback

G

Guest

I am usingVB with .net 1.1 and I wish to set focus to a textbox after the
autopostback event of a dropdownlist. When the user changes the selection of
my dropdownlist an onchange event occurs and the form does autopostback.
After the on change event I need to set focus to the next textbox. How do I
do this>
 
S

SE.Computerguy

I am usingVB with .net 1.1 and I wish to set focus to a textbox after the
autopostback event of a dropdownlist. When the user changes the selection of
my dropdownlist an onchange event occurs and the form does autopostback.
After the on change event I need to set focus to the next textbox. How do I
do this>

This is C# syntax but the idea is the same for VB.

In the page load method have this:
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
"SomeName", <WebControlName>.focus());
 

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top